From patchwork Tue Aug 29 19:45:39 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: 9928183 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 EBE086022E for ; Tue, 29 Aug 2017 19:45:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEFF128A38 for ; Tue, 29 Aug 2017 19:45:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D317028A4D; Tue, 29 Aug 2017 19:45:57 +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 7D8EA28A38 for ; Tue, 29 Aug 2017 19:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbdH2Tpu (ORCPT ); Tue, 29 Aug 2017 15:45:50 -0400 Received: from mout.web.de ([212.227.15.4]:64297 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755AbdH2Tpp (ORCPT ); Tue, 29 Aug 2017 15:45:45 -0400 Received: from [192.168.1.2] ([77.181.80.150]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lxwjk-1dPWV61KJI-015HAl; Tue, 29 Aug 2017 21:45:40 +0200 Subject: [media] as102_fe: Improve a size determination in as102_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <45666d70-6afc-ccfe-c210-a3fb07ee1fb8@users.sourceforge.net> Date: Tue, 29 Aug 2017 21:45:39 +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:REjlrNVTmiuyhaqVvmjN9QA8S9xOjhJ5JVUuxv6SNjscVdI2G91 Y7d25B3Uxml73Ne+Ji9fM6Z1zqVh5BR7yKAi7JXzTN+DVey7NnvuMTR8i2QHxa/U2USQx+z hN0P03MNU+sGGig7gToMq1mTVrs3uvOEZwf6AYyjYmBQ1QLvs4Oq/piFbvizNkHgXqoeC9Z MM/91ai+E1QXS7+ag8pgw== X-UI-Out-Filterresults: notjunk:1; V01:K0:aYteHpCNuDE=:I6gxxb/o2d5rrXzWPuKRyn JmcywBgOD0ZBUItGm8CIkx+R/C6MCDsuw9AtF5tGmjUchS6Ld9Mta7tw64E9W43t1Ud47jT96 FnnJDWOGzgR3f8LhTBiMcMRi4LkmVKwc4/mMzFB9CIpHVzIpBIE0zAeYyjcaGhXSyEI1e5K6z 08sMRDMlCmjkaEEnJ218HG9rZ+7tPSxNXP/dwkdN7j4LHlSevnTTHeVI51sh/XZUowE5S9j4L cjgBTFCYOn3ttk/rRKCrPrGYvhN/vV2NvlskPzXaldU6DfsT+bAk/Q6o8ixTsJjAAIsVpd97y IxcVL19bGsW6z9imCE6qelBLBeijQvpqcjP3n3dYDMcE/v09+MJG48L5FOCQDkEhAFpN+7E2d JmON0A5NgsbuGJrf5qXicKGCe4QQ1tqGWgtV0U4+OBwQj1Qnv6UTBg806jdAnMcQXLT+XdqcT g4aQA8oV9q+nNLwkIe9vJ2MxcSjwTjRyzSHhAu5HOHTul4QwDiWSarP58fL4yP+naM+51WopV qHeLOadfxqwvxnIUizOK9BD1ApOm611WBzOyZd1POxSNKDZzjwUtrSjZvs6QndT8Vggnof9Xk H20F8FCcolPuMPoQ/j3cgmlbpFCTYo4oDbI+dqFxmO6Wxpbrxm/FFRCt9C/f7ed+BhszyZqTx S2yQZdLModvyTGWj5QPqobxpfznPBqVmq/Z3pKUsO1M7cLSMBR+8OHR6+x6yz17D/Ef55wxRY 7QG9uw+Ev2OkgH+m0v+FmuTS4twR5xpUfFGSCGN5MoPkcatifjHCOhx6ufDFsiufkW/24IJeZ ry8lun0qIJ6LUT/ZvwbJKAIzujuzCbUM030//T7OX6ihM7SZ9M= 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: Tue, 29 Aug 2017 21:30:38 +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/dvb-frontends/as102_fe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/as102_fe.c b/drivers/media/dvb-frontends/as102_fe.c index 1fb4ab21d786..b1c84ee914f0 100644 --- a/drivers/media/dvb-frontends/as102_fe.c +++ b/drivers/media/dvb-frontends/as102_fe.c @@ -455,7 +455,7 @@ struct dvb_frontend *as102_attach(const char *name, struct as102_state *state; struct dvb_frontend *fe; - state = kzalloc(sizeof(struct as102_state), GFP_KERNEL); + state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state) return NULL;