From patchwork Sat Feb 3 20:58: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: 10199155 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 A850B60388 for ; Sat, 3 Feb 2018 20:58:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B40E928E56 for ; Sat, 3 Feb 2018 20:58:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8B8728F93; Sat, 3 Feb 2018 20:58:15 +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 4250828E56 for ; Sat, 3 Feb 2018 20:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752983AbeBCU6O (ORCPT ); Sat, 3 Feb 2018 15:58:14 -0500 Received: from mout.web.de ([217.72.192.78]:53920 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802AbeBCU6N (ORCPT ); Sat, 3 Feb 2018 15:58:13 -0500 Received: from [192.168.1.2] ([77.181.226.140]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LgHLE-1f36Mb2bTg-00njVC; Sat, 03 Feb 2018 21:58:05 +0100 Subject: [PATCH 1/2] HID: ntrig: Delete an error message for a failed memory allocation in ntrig_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Cc: LKML , kernel-janitors@vger.kernel.org References: <86d02ef2-0ac2-5462-0ff0-a0cd87c3d1f7@users.sourceforge.net> Message-ID: Date: Sat, 3 Feb 2018 21:58:04 +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: <86d02ef2-0ac2-5462-0ff0-a0cd87c3d1f7@users.sourceforge.net> Content-Language: en-US X-Provags-ID: V03:K0:Pc3GYWruxN9yusHtPkfd0inWGdgtYbNVVU0p6f6z5aVnBhsnqQC voNdApr02YTgFcPQXWdUa2H+epmewMzf7VNLdBRsE6KzoeZ0kDj1P7xehFXPQPwM5SGZx0P oxumxKYgF7EW7T22IpfcklpLOJJsCxQKTwJEchN969Wf7/Bkyb+a5UUUj5MYKddFzqu2GyV bQbZI1ZXheHcWcq1dVMMg== X-UI-Out-Filterresults: notjunk:1; V01:K0:tiqXX9wbGlM=:vMGZWdpC9V0icdlLDFjg9t is703e+7zrANuwdB0+Nb4ewjWHPQxBFwHWvjVoYXaCMF+GhBthAGXrEzfQVm15idJysbIJz20 A6NyCeIDLOSVcLQ/xJLeoPnZ8OKR1Rt63rPFbUCsYSL8yJqVs2ksuKkkFF1J6afb9YGkHI1qV 42y0G6W0EIn62djZJmDZUZnI9r/MMftkaOoa6LTWK3jZW3tga1WtSwro/rvj/BTuDwegA7CGd UsgQh6RA9nkjXUIsGIOjPMnxYUPyKHN8ZL/zGpOIh9Qd157wlkWYpwu5yBpEPDwTO/kebB/78 FFmUGjJQggMz6AzJN+gofxRzMsflbpNxF/wLjVyYUA5uRe6AdyOTh/7ePhwDdchjej7jR8J4S oNb5EFWy5S9qxxahebkF+UPJH5hKuz/uSlD0G8ybqd33oLV9BSXEN8R5IhwsdKzz4nCelxf5i 0roYNNkMQDfFsAM1LJyebQ/I/AAi7p8A6fnFVBoKf80mcR1msJYtO7InLCLUUcEuHtmrfiaY8 cVIPCeUmmXWps3K8Tgfz6RSOJZfV64zhQrU6v6f61ghXbdeuRPpAM5DJE5AJ2UkBEjCrGAmdO i0VD9gpZtGASYHFGSG9eFxrfTWG3RDOpFQr5+OAM7/Nhc7WDQhIfda94BPY/5nuoTqfICWzWF +YNYzxscJbnP4gpQ1pXL0dMO5mSJYzfoylamnXsv9u8PQmmJc8qLrDuqaM+oTP/9X/9rdllPk AqQYo+/YPx++DtbLstVqOEMa8NHp3CTsbxCjENrrmH2dde/6B/n339ZxLpv8TphJnqP7DtsW4 UnfQ1LyOORPPMbeUCB8Y6TuE0AYaUetUhjHg2muvkYVODolRH0= 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, 3 Feb 2018 21:46:20 +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/hid/hid-ntrig.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 3d121d8ee980..2a8dafaea2f0 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -905,10 +905,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) | HID_QUIRK_NO_INIT_REPORTS; nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL); - if (!nd) { - hid_err(hdev, "cannot allocate N-Trig data\n"); + if (!nd) return -ENOMEM; - } nd->reading_mt = 0; nd->min_width = 0;