Received: by 10.223.176.5 with SMTP id f5csp1003430wra; Sat, 3 Feb 2018 15:42:51 -0800 (PST) X-Google-Smtp-Source: AH8x225/bZHYHfeEyle7PeZNSZoAqxQA3FJS0KtU8wVG0Wb/zJWHmrOSseZXwurpw6i7XwImg4Fy X-Received: by 10.99.189.18 with SMTP id a18mr3192640pgf.22.1517701371259; Sat, 03 Feb 2018 15:42:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517701371; cv=none; d=google.com; s=arc-20160816; b=XH2tzzEKJlLm3Ylau7wRUCMdTlLOUPqSXlNWX4d8UnE6rRzS2jZUyNjk+WlAe5DAc5 +8SRUQ735xGoqPQuCIoCmovgSFv4A6wNwVrxIynmwzQKgRKcI1+3bixosZD6jtSTdaxl 6C/O78wciuMiE8IkfQnRis0t4vG2qBBjbFtc2Ygr50bhLLgkGtHEOzH+Xmy55V4bCpyQ Powa7VCXyKkZa8LYs/xFY5x6vHU9vL9SDdOw85WBmPw1lMzW+aElCgsjTNVB1Jk9Y287 epDsXTBcLgKAX4QNctMZtk0LCKFM8WAEDdo3gum0stFuOY8TJyoh32SOdiuevawprMT7 4xqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:arc-authentication-results; bh=pmtRGDznkA/OcSx00i06u/5IjZBJTgltxo3x74twcJ4=; b=rgR2QoRQJFyWq/XWa1P9aLL4+LBpy8zWou2D/omZVnmvLbqolBqukk2N2nunMYOXgO HDOQ7S+oMmrssLqT9MEtmvilNemfcWs6iZhZd6TqGh4ZnL5YQ3wZEOlZTx7KfgWe+1p2 omcCsgWCmX6gdII9kTA1odmi4x8+NWGrjLKdY6h8yhkCfS1/4PTm7uFUu8oFFYdJHSBu CubsH/eTiFscmjFBrTZtyFm9HT/gIuPDkMdS7Ajt0wQR/B13v8QBj2LmC27cULHegJmU EtLXGkgSLFhbvfoR60X/3QTfawEVK0mL48poZ8T6bos6nArLkev+DJ53FEzgtsOM4XCi 6mig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si3508457pgo.780.2018.02.03.15.42.37; Sat, 03 Feb 2018 15:42:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753970AbeBCVUa (ORCPT + 99 others); Sat, 3 Feb 2018 16:20:30 -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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.16.1