From patchwork Sat Sep 16 10:52:30 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: 9954193 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 64CB3601C0 for ; Sat, 16 Sep 2017 10:53:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 519EF2949B for ; Sat, 16 Sep 2017 10:53:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46B052949C; Sat, 16 Sep 2017 10:53:14 +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 A0946294A7 for ; Sat, 16 Sep 2017 10:53:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751273AbdIPKwg (ORCPT ); Sat, 16 Sep 2017 06:52:36 -0400 Received: from mout.web.de ([212.227.15.4]:53263 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751185AbdIPKwf (ORCPT ); Sat, 16 Sep 2017 06:52:35 -0400 Received: from [192.168.1.2] ([78.48.47.134]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lcxjk-1dBLZ83nOa-00iDjM; Sat, 16 Sep 2017 12:52:31 +0200 Subject: [PATCH 2/3] [media] mr800: Improve a size determination in usb_amradio_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Alexey Klimov , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <7efe75db-dbb4-0fe7-509d-908b81072ca1@users.sourceforge.net> Message-ID: Date: Sat, 16 Sep 2017 12:52:30 +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: <7efe75db-dbb4-0fe7-509d-908b81072ca1@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:ZHImcjpTrJGS/yaz4euQwAThMx3nfyM6RKQZDeVsNnCkAo2aP4K Tqyv+072aYVts1zlb5349Q4OFkY737X5mXSQMgmuZr/6fl+dx03VZofkvmXVevbWiH5cFJ6 M5GvdoVpkib1dD13RJW0U9NHzGV6sxlSYBY39lZPdTnRWKRqXWd/nRi6JW/zl3l1V6399PP Io8AIzvA34AJI3HtoR6IQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:AiT4+QQ39N0=:q0Pj7c+8/u+VfhHJWiMUoD xGQ/1m1rTVNVBn//sCWcqM+B6e4y9O60V35Dz3UNpV65e8bMaSZI+imhVEP2eej/yeLtERD2j /LoaSENehWDWj6ccCnODM8jG2gagcTbRUIOHulfvlP9eGZgEGiVp/CZNo8TOOZvYTU+WuZMsN SW47lyIhydYuCzTXwDm/y66MivsX6Ch46hYo4aXvA0NEB9SkCHBAY26wvo5F8ZV2d3u6IEV3/ He0mXfq9dUigSJegIm2crfHnh8LC8M9F2dMks7uxZ1JHUjVACmNs7Wl2EcsYIz4AEYD7buEge PP23WjrLNFjdXLy/UkzodiTdVIhhC3gDDJIWko7YYtMJHdrfmv6f3iiL9pq4gqBX/leoMhyWc Sus6vJQcaX69kJ07BEGXUfwheLaE32VFaBII1D4Tx+/GEddSyIeUpNLnaz9W35BD19OFlIzlp WRBnI+HXdQk+Tq17iCQqrMJx7EBNObVN7FBb/ZTZTxa+0aa9EGo94b0QB+9yvaJccMkQ89RpE yKjzLtWC/c1DCed/Gdt8zLHXtm9ugsLhFSM4wtUrvrTG9I5ZTPgJ23bQ3LFS3JeU/weCy/QOg Ur/bUWsvCZpwd2dE1wVGvgmlVHI64isHGGBTs9mhiFu4mRHJUHMtw3f6ml7EM09g4X/e3L+HP WnYXfx7FJJIOy6sYMP61KzyzBHiMWlIKSJdEe5t6beUHflt8k1pFxsWPz/SeQBJ1pWTOR46i9 dvpZOHqRq2feuncngGdYHY3cZQ6eG+rayAiKOl61AalBLc+Hb8l3QZRLfaivksUD2wTJbPDp8 to5EivpCyyNAcJK6oICDoeMjuFLSSp+/9R8IVr57sBxxN9EwQ0= 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, 16 Sep 2017 11:34:11 +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/radio/radio-mr800.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 63a9b92ab495..7c4554ce1cf0 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -515,4 +515,3 @@ static int usb_amradio_probe(struct usb_interface *intf, - radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL); - + radio = kzalloc(sizeof(*radio), GFP_KERNEL); if (!radio) {