From patchwork Wed Oct 12 14:53:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9373343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEB7460487 for ; Wed, 12 Oct 2016 14:55:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCA6529E2F for ; Wed, 12 Oct 2016 14:55:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF18C29E3B; Wed, 12 Oct 2016 14:55:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54CA029E2F for ; Wed, 12 Oct 2016 14:55:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755346AbcJLOyg (ORCPT ); Wed, 12 Oct 2016 10:54:36 -0400 Received: from mout.web.de ([212.227.15.4]:57909 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754831AbcJLOye (ORCPT ); Wed, 12 Oct 2016 10:54:34 -0400 Received: from [192.168.1.2] ([78.49.9.22]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MdLsp-1bcONv3odX-00IUpp; Wed, 12 Oct 2016 16:53:29 +0200 Subject: [PATCH 15/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_probe() To: linux-media@vger.kernel.org, Hans Verkuil , "Lad, Prabhakar" , Mauro Carvalho Chehab References: Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Wed, 12 Oct 2016 16:53:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:Xs3/cHx+Cve1SCAaYTB/emuZRn80JotMcWduCBANPYVCkRhX1pG T2XjSzJMNxF0y+zU2EBcS4sH1n23j92UYQgX5utLmEIAK04FncmA5/rw2+VyDibKTy331Z5 NKbXH/TNy1shMrKh3RnDTJ9h2JzWZPgGd0RhJfFoB8qZ/jgCBhubawQmGrcu8NEI/DYr5sX A6UdcmIN5HFxtYG65441g== X-UI-Out-Filterresults: notjunk:1; V01:K0:W6i72Wxly7A=:cvAw9ZCJ3lVsVYXER8whX2 ABTx4ZvlfLipsqeclJ1Y+Q/tSKH3XI9jd2QeqyBDS3XOh0SzLukNidQtqoF7x9jIVsWsYUaV3 NEgUtYUyJBi1dixq4A/lDBU0Pmn2CNV5xQ1Hj9HGUPtkZALqrPzq+7GkqN1szC7oNOaZiSqBM SgxHHb+x92SqRya8h6s0t91i5dAK87BoJdRhnX1m7sTcuP+5DnYwJVlyKv0t9WCWzhCqCO1bU uBTMMgtoO8jp5nUYP43Wz8xdgBvf9QZIrd2ifTGyXIlQFthonXLev7/cMiUjJGMOuXA5W9Kax xpNEmPu2O6jlx9tMMU7XPUnqXQSt9lOzFQtrvcLZv5glbBf8tCP+XKvL6J2JuK9JnM2AEo1tX mH3HpY+Q8EGgiv9SztwXxXyXwphCg8ffJfFqOzUGgEGOakZcndD5AaQ5D1ISXvzQ+fplMERB7 D0h7LU2LkVRFCf5RFBWAY28Av0KYY8//cRaRTJWNNB91KGTECTH3/1vKeWeZv9ho+TPk17/86 6QP35RcM6oH6GiA9hT7uO3wJRQDipS+vzz1QJIvGu9TzBUsJht/i9dCBZSVidR3NIzMrwp7WU Li4M+oVaBZnzq34PSLswG9UYpv22eCUDh425690xF3+VIauptrJTAVIcuRFfxbQoGbDauUfTq x5M3sHvnAkoTlSvHAC8q9uJzGA1sBOXI8p5xVpII7OcPE4DnZ8tvQVAJKgZ23v6bI5YhaLN14 ZwF/ELvlg1i9CdxN34z0GZqgL3VgbgkowC3Nfs7k0sfroh/si5zp3p90CW/Hab0MOzPOOqpjD m7yWmUD Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 12 Oct 2016 10:24:57 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpfe_capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 23142f0..4db3212 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1850,7 +1850,7 @@ static int vpfe_probe(struct platform_device *pdev) } /* Allocate memory for ccdc configuration */ - ccdc_cfg = kmalloc(sizeof(struct ccdc_config), GFP_KERNEL); + ccdc_cfg = kmalloc(sizeof(*ccdc_cfg), GFP_KERNEL); if (!ccdc_cfg) goto probe_free_dev_mem;