From patchwork Fri Jan 26 13:49:07 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: 10185919 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 BE1EC60383 for ; Fri, 26 Jan 2018 13:55:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF8CC29117 for ; Fri, 26 Jan 2018 13:55:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3FF629350; Fri, 26 Jan 2018 13:55:29 +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 5855A29117 for ; Fri, 26 Jan 2018 13:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752354AbeAZNtM (ORCPT ); Fri, 26 Jan 2018 08:49:12 -0500 Received: from mout.web.de ([217.72.192.78]:49384 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbeAZNtL (ORCPT ); Fri, 26 Jan 2018 08:49:11 -0500 Received: from [192.168.1.2] ([77.181.101.79]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Mfq6i-1eT1fT2t6K-00N9ER; Fri, 26 Jan 2018 14:49:07 +0100 Subject: [PATCH 1/2] Input: omap4-keypad: Delete two error messages for a failed memory allocation in omap4_keypad_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Christophe Jaillet , Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org References: <3df8e062-2a39-05c9-bf49-c85fd636abff@users.sourceforge.net> Message-ID: Date: Fri, 26 Jan 2018 14:49:07 +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: <3df8e062-2a39-05c9-bf49-c85fd636abff@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:W773SHyT+PsZU8bK+AFHj0SuJ1N/ftQ8+ck5M3JycRtq0CiwDK3 b9Y8gjG/BtNqE6jPD3DkuhfHzpCsq6o+8BadICrfRuTvY1xmVU4TdKjD+7GvkawJNimyuKc IcdemnA4vHz5ES05gdxrWREQ4erHFJL1SAWtje81PucXeh6nS8cdnWHi/5A/syMWubcvFHa zhBtwtIjHxX/zR3Rrebfw== X-UI-Out-Filterresults: notjunk:1; V01:K0:BNJWoHp5oe8=:lfNr0nU0IBD9DTDSgIxwEp QsfIuFxG4Od3yxoDQcRJdZiC2bnYim7X5EDSbnhDTdUOUGuM9WTWM4sl3cTYIp+hmlE7Ke3WX 4UOAaxIIStgonHzpqpOMCtk5gNeZlNBg1/3EYIXfjVKiwDsdStUvZHVwFVKX8ozFt965qM40D VOcf2Z74gowwMzSMljUOAkKzJ9KQdCOscCuFTp46kkScFOG6LFeu8KZbuuDGTLeu0yMgzNym0 DdD/BruVTaHr/AgzrhTnYIr+kgrKljfADp2JcqTyMGUtDLTuO+u3ryJlJJh37HOkgnXEeK98F fBHBsvynENIRxDKXlt5rdf+Jz+wDeH6w9V7rjB/OhkQwVHYJYD7HHMYkX9HlcXi8WiNYJNg7L BDoeZA0Actpgm78JvFlPQgP/okq7AvzsxEiO8DSSf9Ib5m9KHB/or/Wce2P8hBMlOTKFNQkV5 agzMYovJ9AsQXKU8C7QBZXE4NhjYlfoe/V+VJW1ERTpjB1HTOXNsCfKml8pQal0HwG/TzjAbr 6J9D1/8yIRTShXQybs4MBXWZFtMjdah6uOO+i0mtwk/544tGzW4eVwihBfPnXPWJTgTGRZEJh YgZXGnQoZkt7GkJCJflQuWCWEuo1FnZXdT4ZE8Jnwhy9zIW/b36eG14Lbm0ny24E6OgsKN0s6 lnNkrOsXFuTyOmGGAKMmE1ON5FAwd+t1ZM8lAd+xE/Anskrc7YgaatSZf3IJpo3QEM5ARdIBg 1dH8jGHy8Z6X9VgdgH7zyBL/iAKlw2mS0aIKXL/Mhxop1Z3/0wAO5O5Wd39dvRbGw3LHAxzKU M0yw3cDIxSnF2oZMy4pwGf8QRIB1MN9SVfE0fnDjYftqYqHCFc= 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: Fri, 26 Jan 2018 14:24:35 +0100 Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/input/keyboard/omap4-keypad.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 940d38b08e6b..6fe554e4026e 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -257,10 +257,8 @@ static int omap4_keypad_probe(struct platform_device *pdev) } keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL); - if (!keypad_data) { - dev_err(&pdev->dev, "keypad_data memory allocation failed\n"); + if (!keypad_data) return -ENOMEM; - } keypad_data->irq = irq; @@ -340,7 +338,6 @@ static int omap4_keypad_probe(struct platform_device *pdev) keypad_data->keymap = kzalloc(max_keys * sizeof(keypad_data->keymap[0]), GFP_KERNEL); if (!keypad_data->keymap) { - dev_err(&pdev->dev, "Not enough memory for keymap\n"); error = -ENOMEM; goto err_free_input; }