From patchwork Sat Jan 27 16:14:14 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: 10187549 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 2CD08602C8 for ; Sat, 27 Jan 2018 16:14:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 188D228C3E for ; Sat, 27 Jan 2018 16:14:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D1C228C42; Sat, 27 Jan 2018 16:14:52 +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 99E4928C3E for ; Sat, 27 Jan 2018 16:14:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753180AbeA0QOg (ORCPT ); Sat, 27 Jan 2018 11:14:36 -0500 Received: from mout.web.de ([212.227.17.11]:63732 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690AbeA0QOd (ORCPT ); Sat, 27 Jan 2018 11:14:33 -0500 Received: from [192.168.1.2] ([78.49.117.84]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LwqJw-1eqOIa22vo-016S2K; Sat, 27 Jan 2018 17:14:16 +0100 Subject: [PATCH 1/2] Input: gamecon: Delete an error message for a failed memory allocation 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: <1097eb0c-fd33-3229-90be-417aca3795bd@users.sourceforge.net> Date: Sat, 27 Jan 2018 17:14:14 +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:CQY8np8K7zViepAnh3OvuhO4eNBDZev8Kmq+xnkEDtUYTMz86/j YJDsHvLDWNG5e0zYqiUD7XUojvRi4bsiImyUsItA47KDi8+IJOT0KvC5JUssnuZU3KoMIjQ zObpedzQ4tZ0S6sZwQXItP5kr8lxxGAnL8Kkm9ReMo/qaPRa54ow2OSzwd+LP2xcOfENRdC 40OH8mf4wEOiUvMIEdsVQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Enf72zNVLZw=:/bH17/iEgnpmaFVr+O0t16 inMIy3kZ2sRHMMCOW4ciHqDOJCYi5XmwivVYlyAJt6rKdgvKMj+aGPy9JX6ZSoloOC3pIfhUa t2AiY64a3NW8gj+Es3xsC6RG/ND8hUh5tG0iHTTZTWa0gnKufD0OPWRV8DEBtQ19518UIDMFx D+Pnm4FAcHWBb6f3WzyeYzbEz+z016fwGT6x4zqrrfS3NBcCy/S/JVglXXLvCGcBS2oNVt3hh EUAZ/nwZqm45KcERUBVssZaVN6NQ/wNm+IApcfX01J4qkDkVhSzUcfc2cXVB9cOB4ZPEmm+RH p4hkeZdZuviWaJ9zSRdzT6+cuvsCs1edpaDBnw5h4t4pdNOtP8hjNvg7ju4c/BGunkS1EP40W DY7Tv6CK3Tx2MCdhZAhq1BNwFFOPKOC17FwEIAMJTwf80mPHyCoFuWjULEdzL0YOvT/iVfxK8 cDx2NJNU2z6S2qFpftkpiC9vo1JhO/cAUgndBsYVuOSwll7YHlvvpL3yOQ3fIk8FR9YaZafAh vllOaLxMb/TmiWgVSkVtslFpr6JxEnrVN3fsRJ/y1FTtTRj19rvKiC/IKu9ZS7zZKi7krFYLd X41S8zRG6qrG8J6vZbOUSleSqMLrDBKZbk7o6thuLn/m/npFXZ5Pjd5rEQi6XrZnZavFyahL9 Mnq2lsSHNLW7CX/PmmwW1AR4UFnT7Non5wKXLddZcYbl7+WlZX8Pzef8xpw58hYfBI7Cmggfq 36Cv0+5TIxOpAQvvhuwO8ntACymoraXPPjg+/7F6BNaHC/fOz7IjJD/ZU2+UEVe7de2J0Nq2W B+jqZD4klCpfFZdCKZNjnKrr+S7CWLUdmVDV2hPHq7mfUsRNxU= 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:27:11 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/input/joystick/gamecon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index 2ffb2e8bdc3b..f6006383d30d 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -966,10 +966,8 @@ static void gc_attach(struct parport *pp) } gc = kzalloc(sizeof(struct gc), GFP_KERNEL); - if (!gc) { - pr_err("Not enough memory\n"); + if (!gc) goto err_unreg_pardev; - } mutex_init(&gc->mutex); gc->pd = pd;