From patchwork Sat Feb 3 21:20:10 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: 10199163 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 1FB3F60247 for ; Sat, 3 Feb 2018 21:20:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E62E028FE9 for ; Sat, 3 Feb 2018 21:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C70D128FEB; Sat, 3 Feb 2018 21:20:26 +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 6FF7C28FE9 for ; Sat, 3 Feb 2018 21:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753589AbeBCVUZ (ORCPT ); Sat, 3 Feb 2018 16:20:25 -0500 Received: from mout.web.de ([212.227.17.12]:53391 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbeBCVUY (ORCPT ); Sat, 3 Feb 2018 16:20:24 -0500 Received: from [192.168.1.2] ([77.181.226.140]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LsyZi-1esi8H3Aeg-012U6O; Sat, 03 Feb 2018 22:20:11 +0100 To: linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] HID: magicmouse: Delete an error message for a failed memory allocation in magicmouse_probe() Message-ID: <79c01fa9-647c-5c34-41cc-3bc9c09f38ee@users.sourceforge.net> Date: Sat, 3 Feb 2018 22:20:10 +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-US X-Provags-ID: V03:K0:s7yU8BNNUdGmgrsluPiOw/y5NXmEr5IKfh1BJlSIte16WAManMx sC0LFeiEyhRpAZI4xMnGPFeAO0zH7JyjX4aT/jiC7/h0uFt64n+HokOI/sYbK1IPL2CKnOz TYEMWhbodoDlhZ/dQMQwlQi4L//pRJkqHHwCVjL9cJPV9e6runkpfvU1KxueLI6NwooFoee vwc4yk5bxQZ60SULCo3Kg== X-UI-Out-Filterresults: notjunk:1; V01:K0:ldjAtSBVzs0=:wsYHt9zav2dfFzZD1j59bn AxxA6XoRlEB7N+EOrb6cTW/YCcWzC4biFlyA/2dupsa0h0FBPEo3E1NR/Y4KY2Nxl6VwY96ZG ZKhnUmCP85pA1WdtCJ2SB56ks8AA2bzITp1G63900iDwcM1azA+wlsnYoQMKwvM8AemkM0cQE 4AqJL5azJsDkOvnvkw6SmnEn2Xoy5avMuDxiRirFkKzFU1icatAgKkKgszZBLEICz+cTbrgu8 FFn9+Z+NzCtWbvb6x4m7zcbjkAoGS4ASMpzoPTIdl91YwwgtqUJgp+6I0wXmIk6p3GOmyZx8C FQ11CIS6G/AnpWdpPW9PpUaxZSD9YM3C4A9HOHR3ltNWnv/eNcX7iBhNHCA4e5reNoewsH6OL RvjtetbF7P1UV2r6bg48tU+tazG6u6xxJSTyffL/NlKTWPzymFNVFf41dFYU3zv1FTOmjoH0P YVGAF2mbS44FVFDbMfg5b3VkO8kweJt/oR9htdAF8XJL90TUyIvMmgl1/C3Q9Q1MDKYXo+mTC LGOi93kSq6l1ebTPzF+eoAwik0zsoetPPeI+ALTHFBhOfDH/86sDSxJKG/82V1U8kI0oP9bZA 86h360iPJgjAJ/wkzSc9mnC9aUnzLH4SWoRM5esqLVcKCthdxCsEP5GczPDLZkBlKLEzpmn0W YeyFgK7KwGoP+h5iPhjDwosykB2ohgQcqkgQnku1fpnwZw6ebx800B8mbIJVaUSoo1O06QKXz CX9hlyWSdKysgGHtS9FaSC7yIQzzC+THL5hzZTJbX/do/x2/x+1C7bQERZYfyguqc/RTOAIV3 yf4YQY78QQYJmNftVav552cPFCKDEwuFxwcbfe8BtmdVccNxRY= 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 22:15:05 +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-magicmouse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 42ed887ba0be..8d17a812c5ba 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -501,10 +501,8 @@ static int magicmouse_probe(struct hid_device *hdev, int ret; msc = devm_kzalloc(&hdev->dev, sizeof(*msc), GFP_KERNEL); - if (msc == NULL) { - hid_err(hdev, "can't alloc magicmouse descriptor\n"); + if (!msc) return -ENOMEM; - } msc->scroll_accel = SCROLL_ACCEL_DEFAULT;