From patchwork Sat Aug 26 20:52:41 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: 9923621 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 077C1603FA for ; Sat, 26 Aug 2017 20:53:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD127285D9 for ; Sat, 26 Aug 2017 20:53:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D208E285E4; Sat, 26 Aug 2017 20:53:09 +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 8C877285D9 for ; Sat, 26 Aug 2017 20:53:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751137AbdHZUw6 (ORCPT ); Sat, 26 Aug 2017 16:52:58 -0400 Received: from mout.web.de ([212.227.17.12]:56612 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdHZUw4 (ORCPT ); Sat, 26 Aug 2017 16:52:56 -0400 Received: from [192.168.1.2] ([85.182.38.188]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lpezi-1dIOrN0TwM-00fQ8Z; Sat, 26 Aug 2017 22:52:43 +0200 Subject: [PATCH 3/3] [media] usbvision: Improve a size determination in usbvision_alloc() From: SF Markus Elfring To: linux-media@vger.kernel.org, Davidlohr Bueso , Hans Verkuil , Johan Hovold , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <0c35f860-fcae-4bbf-5b7b-19dd36af25e6@users.sourceforge.net> Date: Sat, 26 Aug 2017 22:52:41 +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:/MhBJWA9hlMjwSEGVgJuGQXskp+Trhfc1Y4TnEysY5HZCPrQPKV q2Sp5KaFPn2TD7iSSchvcmP85pBMvOdZbshkfKlsRWSNt50RSMrs9LPjeaaNAQSkKvjCWLN n7R0odSPh0IDXA8WOfQvIt+Ow/OshHf8gjJ5yVCY3pIfOTJO8NAdWKY5rtkk06H5+4MP4Eo A8ZMXMKFCUlaclDFR4lXQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:3mf9Vo+bjZM=:dH9meVw8yIeeiW7ywFSuU3 GHXe6cVGUjCE7qxHJ7Cc9jpwdGxKVDO6UgxZMfrHDmFAr4zsHFF4fQBywHrF4FfY5acC5+dkP 3xqQXEdy/pURHXCtY+tOKZSIeLhDqXN14KOo2p7rkt85wb6aLnAKuH6IOTeEQVIeFEYLqS7yT dPISKE5y2JUTPBdWfUOIVL2OIztg2B3l4UQMC3RTD6fClsy6j5gIBDF4TUesf8yRbrLY17QKn Yijc9PjbJbdW6jdgFDqdsZzvyb5fcm11Gd/4kd+3VHsRKjhzXBteOfbrGgNQA+CVs8GeTrU2w NC9SRkDsgc+IA2mhV0rlPsB0aCSQk3h5F50M3IFTOLj7neOSBu2+xRSF9Sg91PyYvx31G5fRC PgBwwwFIVHDsh2PsmMC9tHP101JXjOl+vMmcIupxK6X8Q4V9p8QRHCPu3tmQqkmUqHEyYMljf n+PotjJN4A++6M7mFlnB+TeSfhOTsNgcjM8lDULHzj7MCy9YR/Xdsl56r0JHhFjxSFL4dl9+b bty+jbDIdluonwq04Str9F5yWosPAvUxXIhmylc+6DjdvhoDOAGxAhIHvYFd4EqEK+KDsm043 Mjc5qoKy0J7TL5z42uwDDoGmXxGLurNnw4pyncx2F3TAhvvQ13yUtadH9kLGRQ1eRskI1O29B 2VRKbhFFpQvz6ap0+ZcACe9Xqy++jZ8y/braLgz4VVjTsr007ultEZVKQMnkCrjvspClslbsd ew3MknwlW+lWBTxgOBTRVpyOtyyy3Tg4T2Fr9iRwJ2ONmHmNEySpiaF7nLxlutvywSlbsDVpU YKibN4qTKTqwXJCvGTcFpYQJYpWxW+roR3tEmr7AtWq5bTS1mc= 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: Sat, 26 Aug 2017 22:22:13 +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/usbvision/usbvision-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c index e6807bad9792..960272d3c924 100644 --- a/drivers/media/usb/usbvision/usbvision-video.c +++ b/drivers/media/usb/usbvision/usbvision-video.c @@ -1319,7 +1319,7 @@ static struct usb_usbvision *usbvision_alloc(struct usb_device *dev, { struct usb_usbvision *usbvision; - usbvision = kzalloc(sizeof(struct usb_usbvision), GFP_KERNEL); + usbvision = kzalloc(sizeof(*usbvision), GFP_KERNEL); if (!usbvision) return NULL;