Received: by 10.223.176.5 with SMTP id f5csp761963wra; Sat, 3 Feb 2018 09:41:17 -0800 (PST) X-Google-Smtp-Source: AH8x224FCTmH1p8WIBacPQrhuThCSP9JZNHvlVNAA/RvuUKSCU6eU55U4pmUUlnfdXjZDmyw5VkK X-Received: by 10.98.63.142 with SMTP id z14mr3135930pfj.95.1517679677494; Sat, 03 Feb 2018 09:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517679677; cv=none; d=google.com; s=arc-20160816; b=oeRXsWmJRuxFH7BAheEAlNxSr7neBeNcjn1+5lcriQzfHh3zmpNYZ/lZpgWN22vQ5p 7VyYH0MZaAEqJbIvt5WgGBgSXT18jDD35p0k39lHJ3vtE6rXHOCf9dKrLlz9vFjVTx/0 6oorHc17xtfkFpZ+BRRWdFV8mJV8NW8T9GVSJWM8/40pCe/e5NEYNTMv/RNmcpl08JhE eqqPTFzOI3ZFsu+5Q0w/su88mulWV1ZogK21UgtIlL49/XaLCM80gBYYBoedI4/+mDB5 XQIff/NviD8FDgIKJYFvHMA/OC4W8l6ycYW5+b01OALTkBAEeUrVrzhQvdptsBum9rrQ 7qFg== 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:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=ezjypue6AdsJfBySr0ihZdF9VQ2fXChgj7ea+XC2nns=; b=BnrGZTBE+ZQPd2eUPPd7ovobxLw1Ie0fAxKC2QJ5/8nf99iv4Ocx8kWMQoK+H+/T4H yGkRvA+8cHtYNve7/CYKkDyab6wqqy2O8ekK9W01cGALwTwsbZc/ycynvw7jkS1Cl8gk hvm7SB4m3+P1x54/pHE7BzOjsI9eehLoe9Z6hQF122ifUAUlzM51wapMONzCUgTzWJf5 64xHXCVL/YhDj4tBRdBb92ZJNzksCW79DjR8HQ8TFnWgl1z/35eCQyPF6MtP0lbbna6F BTrsZXxFJm3G1WOY6agAYh6cYTLXzL0WCMRqAIaGd5wpbofT4VRkHwNpY6hz8E/p0RJ4 Ctvg== 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 p11-v6si2271905pls.826.2018.02.03.09.41.03; Sat, 03 Feb 2018 09:41:17 -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 S1752790AbeBCRiE (ORCPT + 99 others); Sat, 3 Feb 2018 12:38:04 -0500 Received: from mout.web.de ([212.227.17.11]:51091 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752606AbeBCRh6 (ORCPT ); Sat, 3 Feb 2018 12:37:58 -0500 Received: from [192.168.1.2] ([77.181.226.140]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MMmt1-1eezku0y4t-008X8Y; Sat, 03 Feb 2018 18:37:51 +0100 Subject: [PATCH 1/6] hid-prodikeys: Delete two error messages for a failed memory allocation in pk_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Sat, 3 Feb 2018 18:37:50 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:jYPWiTxD1lLDzN09jdossElu3S/m8yLs0C7Dq2Xm7i59Ym2WGCE cM2/qUnsNkjwKGdUcAxowGn/32Y6PiWAQoWKzdPvGJcWaXmrFnbGwRjurpzmVRqnjCIFAUq 1mjgLNRIPa6nf9obNW6m2I7CMbmRLEmsisgnEL9AEklEmqYmLkRxFO+NmiPQZbAOG3dHvIb DqfB2A/nL0ww9fkWePRuQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:80yxfNSA/zE=:nGXuHHS5L3uNwJR0mowjrt uUxz7DVlJntdzEHQ+CAakWiIgXS9NinBzjSX32d1YqI88+BWui9aII1Z4Sh2PxxZORZqnpBAx 1Htz6+d2fjfWfp6U3DoSitxFAA3nr8QFuUReRgl0LEComL6HCIzu5Nt872q4OS+wJPCSt4zs+ wSgNpKbr7Fjia1rDcbZIcaBgvCwQHYKwPPk+TBB/B/kitrrATqPT3xNgBvZxu0S4ftnqpQcgI eW4wgB/ZXNqtRWsTBIDcM5z08BS9o07Tk13HTLBEtE42hcXUNSCDm9sUVpmTXHMM8sVIeHDtr 4QI7LGL8nLZjzjTxpDuIQPdsHUPFfi7ChPFgvh3D0wc4BUUQzk9beNrzr9D8YIKURTemVaAtm 9s1ni7OULSunBGHKCfNIKAgMA/QTQwPTLQRwwhvQ08hpdlKbGVpWUX/nBDuT7J1y8kMAERUt3 dkmIKhx3QCA7iLAviYzu8L+Zr5kDOj03LKC+XWbIbMj5Tp8K7LeQ3Fe3dUuk7nbowzAMQY74X LrLY0UB8CqQ/mFf/zZw8K79IG/811G+RNHVjvYpSTqE2jbxQQfrl3f8KKdbi1AWs7mWiY/2XV pFQObEP+DpyrFRONITUJVXxAIKRJ505Pi+RyMtTgv++EZK8EnzeS/Kipv24Au66OcvwBG8gp4 dJKMkR/o2NMIVWX2hhkMibA6mnQ/SUVIp4qf7gzz+KGtUmWWLhZGsgP3Nu1TQe2RiVforRIaF sYmLy/vOcPnUse6SeMYMHyRQDMW+ka1/1L+xbQFkC5JWVHyGfUvOkacSK+TQ2qy74rTQX2Mmd 5cpIagqs1bdOUXkOXUnOvPO4epEsIBPFI+Rm6BAonfCxpOGb+w= 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 14:36:20 +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/hid/hid-prodikeys.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c index 87eda34ea2f8..9cad4973a67b 100644 --- a/drivers/hid/hid-prodikeys.c +++ b/drivers/hid/hid-prodikeys.c @@ -802,15 +802,12 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) pk = kzalloc(sizeof(*pk), GFP_KERNEL); - if (pk == NULL) { - hid_err(hdev, "can't alloc descriptor\n"); + if (!pk) return -ENOMEM; - } pk->hdev = hdev; pm = kzalloc(sizeof(*pm), GFP_KERNEL); if (pm == NULL) { - hid_err(hdev, "can't alloc descriptor\n"); ret = -ENOMEM; goto err_free_pk; } -- 2.16.1