From patchwork Sat Jan 27 15:00:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10187525 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 4A28A60385 for ; Sat, 27 Jan 2018 15:00:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D02628D29 for ; Sat, 27 Jan 2018 15:00:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79C4428CFB; Sat, 27 Jan 2018 15:00:12 +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 85F3128CE9 for ; Sat, 27 Jan 2018 15:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752874AbeA0PAH (ORCPT ); Sat, 27 Jan 2018 10:00:07 -0500 Received: from mout.web.de ([212.227.17.11]:57677 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752789AbeA0PAG (ORCPT ); Sat, 27 Jan 2018 10:00:06 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MeSOZ-1ePpwx0fRn-00QA59; Sat, 27 Jan 2018 16:00:04 +0100 Subject: [PATCH 2/2] Input: turbografx: Improve a size determination in tgfx_attach() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov , Geliang Tang , Kees Cook Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <14ac4f8d-90bd-0ad7-eee8-fbb47c2cba5c@users.sourceforge.net> Date: Sat, 27 Jan 2018 16:00:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:x+I0yelIxmRBHdgnxCGxfGrjT0VQa4KilqNfJNa6TCi5BbOQWgA MwUxyb4xuptyJ8UVdPIp/Cgha4KEzjjLTNR0bWWNSBbj2N02mD3YgoGOJLBJKt5RSjPXQo7 bCy0FYxLdhn2fV8gw6TjnTw8Z6GdOgpQeeS4qHx5WWDTqLmTZOPQ0Hwhb5FY3/5mytxCWmr bFH3+Xf3aTS/lpcgDmrpQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:c8BdvbZbOPg=:5tjB9dl/fDxkOwFwnugnWY ZIbvA4sO+ziop1QOe7Dlxorif+ez3DLrogf2cbI1GDNDnBhqVQY7tcNgCRaLqkRwklqXiSp55 eIZkKlvxWKiofhUXZwwmTCop9v6zNQA6kJOIEYXGjFhFn7UTQ53QMZbGw9VXpHePh9teqXtuH 2g8t7/40sY53mO+b/Ba4iRJXqSL4DZ6uccXvVvxPwZ4vmb9UrCvsemuoq/4DyX4m/IYpEr0c4 wzHsxcLApf6DiZ0gwCDYPkJAGBUxNQgiQBhpzzuE3bAutmLtn+rAg1XPW4lOGisUMbkFYeOR4 bB8iXchWUbe/konLDIQDsEqwTiMPCrSYG/JC8woYnZ4Ss02zQ2sCo7RgC25tw7MRsiKwcf7LJ lkN7NBrqirqXBVI6R08GOVfp+T7v4FQB+iDrw4LWbGTxJZ1PnJsJ4+HgninqOEOLKlS9ndSPs IdkcpXJwnKrF3PJgwA8B0Oyd+TvncqfrC/oVyCe4oCjl+c28++J+uFIADIdsqJcoJwzCy+2vs hF5Kn3UjJty5+n2AhxCgFrlYvPj688gJFMwmeVw6rojxQdJKDseAs+ihBoVc47g8V6/UF8bEx v0qWTxfUubl1234Te1dr977wWqu0W86jCRqTTNaIX7uqYrArMwsfGqZYyI0Up48nptg70jT66 xIuuEqaiw21fKNIGv8C3KwmocVhhtQR+erEbnu4O/q5HTc/L9qa/obT6jcnci4lav/LobhMEN +MQ3WUNSiV6qxBPk0lFZ/3/NCBbfltAlcGXBrHTn8nu4RZU8ARp6pFiWtC+7qYfT4oZ7Bxtz6 1IOmn/NI/Jqs3S2ajBEO03mojB0yyaE/h/y4wtSXE/FCKOC92Q= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 27 Jan 2018 15:46:24 +0100 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/input/joystick/turbografx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 454d4c032292..472bc438927e 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c @@ -191,7 +191,7 @@ static void tgfx_attach(struct parport *pp) return; } - tgfx = kzalloc(sizeof(struct tgfx), GFP_KERNEL); + tgfx = kzalloc(sizeof(*tgfx), GFP_KERNEL); if (!tgfx) goto err_unreg_pardev;