From patchwork Sat Jan 27 16:15:21 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: 10187553 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 7399D601D5 for ; Sat, 27 Jan 2018 16:15:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD602811E for ; Sat, 27 Jan 2018 16:15:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50F6028AC9; Sat, 27 Jan 2018 16:15:54 +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 F1AB42811E for ; Sat, 27 Jan 2018 16:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753008AbeA0QPk (ORCPT ); Sat, 27 Jan 2018 11:15:40 -0500 Received: from mout.web.de ([212.227.17.11]:52791 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751619AbeA0QPj (ORCPT ); Sat, 27 Jan 2018 11:15:39 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LjJPH-1fC3jI07Yt-00daII; Sat, 27 Jan 2018 17:15:23 +0100 Subject: [PATCH 2/2] Input: gamecon: Improve a size determination in gc_attach() From: SF Markus Elfring To: linux-input@vger.kernel.org, Dmitry Torokhov , "Gustavo A. R. Silva" , Joe Perches , Kees Cook Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <423af7ee-401a-5e6a-b7f1-fb9b223a2b75@users.sourceforge.net> Date: Sat, 27 Jan 2018 17:15:21 +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:F7Nft6tKV1D8BUJoG3+4/tdKMoUVB6vLhcm3wOPO5traUBlk5S1 3XvRM171KTZ0Y+1yzdIPFteSXt4eZCSk6AQv4HjZ2NqGnqSBIbHqBjJW9SIuA6MiXgwCVdQ /lY27iM23mEqYo4o+maCaRDZ9uK8lPGOENRXLDAtxpryRL6jq7UH5vX/Bp+dVjRQygt79zd +fsz/y17LGY6qqhxd1f7A== X-UI-Out-Filterresults: notjunk:1; V01:K0:9XzdY5gFBGY=:Xo4wmKi55cKeXX2PwqgypU eYL7zE6Q1cvF8Rzq+eyN1zSXddq9pEyt9+6o/f+A3yBri20tFk2z465vf7nBubo2aGTyDlDkC 4fc0Icg76POIKh5VRjXlR8fJwE78Wrj0R9UVLTZiTu+sIG2Ii/TosaBnwkr9ZhkK88Gdeqf4n fuhD7gZj6aaCHe2MuIbvqWpio71hlXm53X4U1dnO0eiEr2M2NmmAjyQedebhWLhuRtIDAXz7s 6jN8UbSn7tZF5N9eijDkExsB1qjTKd3718VK0gz/aKNJ6v+0dDy0ud9zv82dhnG2V7rGIoGoy dLsolD/FSmS8Tap2YKBBc+VJ0puhsdYMAd/TU+ZVXzqryDxOyh73ePdJvBu8aBbm1rc2hMC6g PuKDRVUhti9m/3OdRoPX38MeuvJ+SNXBGDQSwzY7UxaGKMcWsYirEamu8SEdfBggX04VE3Dzw gqlaQBEyJnI2ERRI1Jk4SijccCDIvSkBa0tSlvekLT0D+ZPRd64XojqxYXf6RLG4gYaKDzwjZ V7AYjphjRhKzlwx7nAfm6rF4H/III8kxkn82WUf7aFW3assoed0jKxw6LXgVe7a8LukeRQxmc S4LKWqIpEa5PWj79vRoPD7NZjCxb1SELN4XY3JtcJd5og0VZztY5r3g07gibn/VNpmqygg4Ao U7iQQHNMI1fLy2zfshNQb5UBDlSME9+3wMF1p5gJ4i90cK3YExriUYEEM6RmRdm+KiLqM0UL9 ZXnMad7FMxNRQBkVhQOkya0bi4h84crnVom1yKd6k1KO1SRPlYleUa8oOTVuP0TA8y3+1znwf Sk7B09NggRlIYYCPFazNAfsRDmEpe6KOHMPDVVpUScm9R3rE6g= 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 16:30:58 +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/gamecon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index f6006383d30d..0e3d47ab9ab9 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -965,7 +965,7 @@ static void gc_attach(struct parport *pp) return; } - gc = kzalloc(sizeof(struct gc), GFP_KERNEL); + gc = kzalloc(sizeof(*gc), GFP_KERNEL); if (!gc) goto err_unreg_pardev;