From patchwork Thu Jan 25 20:12:04 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: 10184765 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 05DEA60233 for ; Thu, 25 Jan 2018 20:12:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E67AF28B5B for ; Thu, 25 Jan 2018 20:12:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8DD128B5E; Thu, 25 Jan 2018 20:12:10 +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 C85AE28B5B for ; Thu, 25 Jan 2018 20:12:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751191AbeAYUMI (ORCPT ); Thu, 25 Jan 2018 15:12:08 -0500 Received: from mout.web.de ([212.227.15.4]:49268 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108AbeAYUMH (ORCPT ); Thu, 25 Jan 2018 15:12:07 -0500 Received: from [192.168.1.2] ([92.227.186.52]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MI6JC-1ed9Bb2Qe6-003sqv; Thu, 25 Jan 2018 21:12:05 +0100 To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] Input: matrix-keymap: Delete an error message for a failed memory allocation in matrix_keypad_build_keymap() Message-ID: <78153741-c125-3aa9-59c1-807d842a98e1@users.sourceforge.net> Date: Thu, 25 Jan 2018 21:12:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:JkEIGvKox1hi5VwzNhf0mIaY9KK8EuU26F0u7gS4Vp97F+js3tF HeLpC0GmGZX5L704ys2ORgXwsVxay6EeDeaJEb5iJQfC9O2XrIC2biSO5LKHQW3K0PQhFw9 KoO0WoZaZgwI8kgVCY+JgbghS74TszmXLRnvJP+VV/i/SAkwAz5NXFR0jZlnOyURe8MYUE9 OoDR4KUMxFZmuunLKP9nA== X-UI-Out-Filterresults: notjunk:1; V01:K0:jqmmnN0nGIk=:OQs7XYwQzx5hfC7NzHqSGZ gUe3Rmerpf2mz6aW5bV0eg5zSgoMIRgsP+UfsHEq6yiZTq1ATgbcAC+qFScSUvPB3oaWNZga6 4xaHVvOQMCFZF8uYYvre3xQwfetAxYU7dtV7OEoiYTz+XEQtYkVhlUL0XIjpWy14OlGx+fYHW 6anb/VSijbVFzwknUvYLtVx4/z5Ztuh0WLIJ9KUTfB4fUzavd9w46BeXFO9WRR3EZY1XzPkfw IOuT8XIsPxM9Y7wSfC3RSX48AyQc/ZEnNXtmSq3wuq5edDUM8dymRPV+Wbv7Cj8X78lcT6fuZ lDZPoktY6ykziR4GHpe1FFk/EUbUl+Lwmq5BRR3Y7xum+0w0y3S1Vz0GsM6LbJ+HW0TTRfvP3 e7uXWVPma5/Alh2//8NX02VxYJ1apPxgMHVemIKnVSGtlZr7eFhgkfZsRSd5TBblkuSPcLSsi pcsvVm57agnLidqHL5gjn0vlqQt3FfDFB2pHo35swgEqVmOhkHBHKPi0RBJVfFM/995lq0wL2 iPWqmHJffRi6l6YplLVPiuwG6uiBVMgQMl0+qn5L8cYrust4QeGLPIYup/FQWMi4mAvjKqnR6 +So6HzkN99FItGfWJvcObv9gVG0DH1dRYEpvzgdiBb5MRX9MCONwtOdEdxB585NGzP63pbCv1 biqwQu0rvUyyRsh18rF1fyPWIR8ZvraItuDxsHs5mH/wxuYvvHluT6EC5a35KNqMJT3ck0T/e 6odjHOVLFWm3l7+sXfSyznxLfnqp8j5/1iLQAYRKotszInqSid2NM/+1k1Mqbdc4msi+cajre MimJFn7FOYpEsS8xhziOiHHslB7H9WSV1h97V4JyK0hmggwg4E= 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: Thu, 25 Jan 2018 21:07:00 +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/matrix-keymap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/input/matrix-keymap.c b/drivers/input/matrix-keymap.c index 8ccefc15c7a4..298bd56b02bd 100644 --- a/drivers/input/matrix-keymap.c +++ b/drivers/input/matrix-keymap.c @@ -173,11 +173,8 @@ int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data, keymap = devm_kzalloc(input_dev->dev.parent, max_keys * sizeof(*keymap), GFP_KERNEL); - if (!keymap) { - dev_err(input_dev->dev.parent, - "Unable to allocate memory for keymap"); + if (!keymap) return -ENOMEM; - } } input_dev->keycode = keymap;