Received: by 10.223.176.5 with SMTP id f5csp747009wra; Tue, 6 Feb 2018 06:46:27 -0800 (PST) X-Google-Smtp-Source: AH8x226w3FXttNcDevgSU7B4Eo7Z+bb1o8w/cTj42ASkGCnmgwjj0mhCmXCYVANLdnnme0EBHR7s X-Received: by 10.101.88.141 with SMTP id d13mr2133275pgu.438.1517928387468; Tue, 06 Feb 2018 06:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517928387; cv=none; d=google.com; s=arc-20160816; b=dKx5n5EFYvoPx1aI4PSfJd/C23aobOaIlAWaijWYkQDsRPFLvmDCpDE9jutcGyQ+q+ GO8jO+LJ4AvVwQcXUvFr4wW63mxtLbPF7YPIMFYe48fcCI11FwV315jFf2W98d8jcxFI GT0eSo98KIExq4Ptw977eql3C+askTPTC9gVdHb1KuFMRjN9ooBOU0mBnVfAJh4iSc4B ZfcTgLWydUhzPbEKcMG1ILvo79DEeS9Xg0RJNhkrlhJQhnNQxISljQaqYbSKbN0Ivs4a Rw/zI0OxL0VlXjbnFAOaFuJ01lnLX2u+xNKe8zqSsEg/46F5ZbTXY8qQ3+FKtapWj80K sWVA== 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=F2b78i7zW5f0Yh2P37WpnrNgphodhapYqxSU1HeQS40=; b=NO/rsEa5VUQh25BM+ElEBjaFkKYg5NJEOZVdTqtcfdEI0lrSyxvNgXm8rLigEjEtv0 UKPkxxhe/nDpmg0JJetJLBJRzQdSA0iat9mEljFAlmvqPrVGv5ukgc2eciCqcPUxAEpy wD66B1rkGB5tM61rfk8YNnwik9lz5dWCE7UqeubG8LruNwEbp+rQAuNQFFm5vR94FpeO 37/sNJGpo74SXgspnWLDg4KncIQJ8VhDm07/QOumOaLW5edR5xAdyvRtBqPJbarDAK7q EbSwU01l9MQ5RFVAKA3+2+mieQN449uCRjQwtM3v4rdXgfNQPfPXfNx77JjPpMEu1sY2 JpJg== 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 v85si1421920pgb.231.2018.02.06.06.46.12; Tue, 06 Feb 2018 06:46:27 -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 S1752237AbeBFOp3 (ORCPT + 99 others); Tue, 6 Feb 2018 09:45:29 -0500 Received: from mout.web.de ([212.227.15.4]:65393 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbeBFOpW (ORCPT ); Tue, 6 Feb 2018 09:45:22 -0500 Received: from [192.168.1.2] ([92.225.242.179]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LlWVj-1fJV2k4AIZ-00bIuU; Tue, 06 Feb 2018 15:45:14 +0100 Subject: [PATCH 1/3] hid-lg: Delete an error message for a failed memory allocation in lg_probe() From: SF Markus Elfring To: linux-input@vger.kernel.org, Benjamin Tissoires , Jiri Kosina Cc: LKML , kernel-janitors@vger.kernel.org References: <5c76a767-b1cb-2486-f24d-0d5a220b8985@users.sourceforge.net> Message-ID: <14c9b364-5a38-88f3-0cd4-913ca95dfc31@users.sourceforge.net> Date: Tue, 6 Feb 2018 15:45:13 +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: <5c76a767-b1cb-2486-f24d-0d5a220b8985@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:/J/jIv4doQ5Hs2H3n8xhmtO5EJOqt7AIRQC5iDLhfk4G7LVX8u9 aE5ICEM1ys4FlZQtbDtx9UhbRc7/kZMUPKpAc+BLSPsHcmXlq+8U8eXUurht3HCPctGaBf6 olEzAfkQ16Ux1atgoEKkz02J0JoytGkAy13rVLIdRfK3hvGiROE+YZ5SWWCA2Mt+RP+Pprq 4vSoK2pEb2vO9KSXJdA6g== X-UI-Out-Filterresults: notjunk:1;V01:K0:AR0DzQMELo0=:ejN9luKEfim8NevHeuzhcz XYVWH1a1X61AY1FvwoWvEArz5TmJFkqPoGB3xeNBn1T/K0AKYucvug7mRYx2cgSxY0fRbjNT7 cSjUoiAxHT5F5f2gB3uNBie3GfWqaTE5251DEqdO5fFla8w73Q25t5Kv9wsgS+tNcQxSrVI5Y Gff66864HOc+OsIR1enMp73Ip/WvA5/pqihR9Dc+cwpFProzVRnoV7noUW9gIw0SdXAASdQCE 5HO8I7MKY6IeSwGS7ek1KjLxQiWAPKNBQqvD/z5s6XYi2foBuH9VVeAK6KAWXXxFPXRWZJBVT mtzWzPs+FZ2ZTRe66QeVEb4d74l5KnJBksP4JiP4IWTfShyVuCi4RmpByXPSPAeZJDHtKe/0H JRJJPpJc+El4+Xtj0xdt1IOMwb/Ow04pxKn4XTGLdfNgsHQ0u6W/reZfsh2oF0jqZRCsUiDKm i0zpIBYqSKcOH4RAcp3XxkMtFFSXH54ZmfXG+TrNIf5PBYkE+G9xQJh3lrfIVbyezWLBx03pw 2w041Ku2SiZVzrVRaqVWopQdw2PI5GSLo8B4p/xDyXf1QA/vzapgfh9e4TQuV38Frgl+tJA8J zHbtWgtcivt+pztHHB921tvxChcqQeLUaL9eNPWOA51qhV++8uVX1/zlXQfuS1Ccy61VdW2G/ uXSjYYBkl74wNEGbwWGUsL9ISNgene7HHfoHEiLUrAd2NMO65cZQ30FTMRnjPYw62tTQQCd6H RCxUmsbA5Y6vZorHNCYzvAJWRkCNlL0oM3zEg6lhwoRomNZ3NSMGKwyWcdvrx35mP+GsgkgJd HEDUcdy9lB9Qdp0nFd+S6C/bYCnRB+SplZLtwIZ6AvV6m7qYl8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Tue, 6 Feb 2018 14:25:32 +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-lg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 596227ddb6e0..f4439dc64497 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c @@ -728,10 +728,9 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) } drv_data = kzalloc(sizeof(struct lg_drv_data), GFP_KERNEL); - if (!drv_data) { - hid_err(hdev, "Insufficient memory, cannot allocate driver data\n"); + if (!drv_data) return -ENOMEM; - } + drv_data->quirks = id->driver_data; hid_set_drvdata(hdev, (void *)drv_data); -- 2.16.1