From patchwork Tue Aug 29 05:33:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9926755 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 A2CFF60380 for ; Tue, 29 Aug 2017 05:33:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A22628865 for ; Tue, 29 Aug 2017 05:33:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F2432886A; Tue, 29 Aug 2017 05:33:23 +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=unavailable 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 DD09828865 for ; Tue, 29 Aug 2017 05:33:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751250AbdH2FdJ (ORCPT ); Tue, 29 Aug 2017 01:33:09 -0400 Received: from mout.web.de ([212.227.15.4]:54497 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751218AbdH2FdI (ORCPT ); Tue, 29 Aug 2017 01:33:08 -0400 Received: from [192.168.1.2] ([77.181.80.150]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lp712-1dGVaN1Ecm-00ev08; Tue, 29 Aug 2017 07:33:03 +0200 Subject: [PATCH 2/4] [media] zr364xx: Improve a size determination in zr364xx_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, linux-usb@vger.kernel.org, Antoine Jacquet , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <19adacd0-3862-188f-9128-5d09fd13ebae@users.sourceforge.net> Date: Tue, 29 Aug 2017 07:33:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:qPKgIaerR9Bcj8W/CVocrMoiJjxYXCtKi+UJqh9Dea+zwxXaM5g 45bIbRdl4MsdNFqMGpOnPFs7Ph3a0n4KJynXyN5kTqfaDfM438aeV7czjO9OsU23HEaNkMU RMHbpAtcoYMiNmSU/c2Hi8mqg3/xlOtEgceKCpVdtK/DHnFkIxnGCGzR1SmawNFpXoYSev+ gVzO4d4QUPPsOj+fAlRRQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZoXx4163qTw=:vckG4axv2k2dfEBCqMUPPH LC6WSLn433duZyPlvbDeg80D6d3iJVpbhP+guaSVWUyIdv4w7bfdxlgmo2QHFuKjl6wJzu/Ra FZZnDJ8zwqttnoz8Q8nOQLecgH0Tsy3dWsvimxgDXlBAYXFA2BeyG7FRWeJ/H+EtALGo77zQX TgVRjVeuUxm1bbCqNtp3ZXx8HO85+hdxgMa+ntv3C3gbrou1BILHIWOHqr1xR4kuhoIeqS3rz KfypCJ6HBJmJ4KE1B3pXfiUQW70erOe7iMkeBr3JJhLviEJEs4y4E3O1prrfNht5fxrlaR3BO rgQe2bIwHL2yDvufUytCrj6TUOnzIHO53HXn8Ly/2lFhzHp/z6wIpB37kmxcde72ViTMspTo1 VqvaFyXAhN30GBzn373KPL3+gFz2PnTRgSL8y9+oHs7TSFND11XCqAI7SgYTsgIJ/PdUncCxI cRQ2wBNp+9ZBx0+iC1WLTYEZalwikDyuqkrAPK5euu7Wyk16CkMVJpYRSSUmUMu9NK9LvIkTd zh12OLftAzQsMXF86KfdZW2ghEBZwkjxEihDFV98j7sISfCWTPiV9YFjDuG3MgHNC4rahxgh6 ztyng26I1goKrIiRJiF3gSGUktyq2bYPN6lhH5V4A/Xin2wqUTH74tduyekMyxXYMoKv2TA/j AOO/K4CiGo23nlm5o4KKudLsfG9gqIBztHXHEounoZFpDsaKp2IcaxKdLM6zmrkJztCzshFNv Y8fxccAPOnWIMX4GwFob6Ziytuyxcsk6PSUA0c958VVV37zGCBk6vZ20hnQaOq6X25dFb1jli 8HUbEejh0Nw4EcxVW7mkpDjfupfDOo/3m/BID212GXB5qsX94E= 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: Mon, 28 Aug 2017 22:28:02 +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 according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/usb/zr364xx/zr364xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index 97af697dcc81..37cd6e20e68a 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c @@ -1421,7 +1421,7 @@ static int zr364xx_probe(struct usb_interface *intf, le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idProduct)); - cam = kzalloc(sizeof(struct zr364xx_camera), GFP_KERNEL); + cam = kzalloc(sizeof(*cam), GFP_KERNEL); if (!cam) return -ENOMEM;