From patchwork Wed Jan 31 20:43: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: 10194795 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 E4D39603EE for ; Wed, 31 Jan 2018 20:43:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE7D7283C3 for ; Wed, 31 Jan 2018 20:43:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2A3D287EF; Wed, 31 Jan 2018 20:43:55 +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 786FC283C3 for ; Wed, 31 Jan 2018 20:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751755AbeAaUnl (ORCPT ); Wed, 31 Jan 2018 15:43:41 -0500 Received: from mout.web.de ([212.227.15.3]:49865 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbeAaUnk (ORCPT ); Wed, 31 Jan 2018 15:43:40 -0500 Received: from [192.168.1.2] ([77.182.166.142]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MTQ07-1eHRyx359z-00SOth; Wed, 31 Jan 2018 21:43:12 +0100 To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org, Hartmut Knaack , Jiri Kosina , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Srinivas Pandruvada Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] hid-sensor-gyro-3d: Delete an error message for a failed memory allocation in hid_gyro_3d_probe() Message-ID: Date: Wed, 31 Jan 2018 21:43: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:bW8OlT1sFOuqBmOVquRWGsBcOjsGxz1FSz7/RoGL+d7Ui/qAP/D 7/NEWOvrJG5i4Tiqgq9nDFsEN0PVbTCQlDHSCOaudt8rQ/2e9IQwOMeSZXnHTqxuOgTk49C PLVeeZAJKhYoXCP3MoJBXTHxG4fuAc11jQUTSzUKByPzSqVSnq/w+WE2P4lb0Z/z1Ke5gKW FODGextCo1hkGiOv/Br0g== X-UI-Out-Filterresults: notjunk:1; V01:K0:4BHnivZAgvo=:g5d5soyAUPrMFA0NNLxjha Cx7WGekwsakFZhkguTNLRBANqdqElc9DHjhsyokO83DnFv/mHvkVEJ7WFZolfjLUSCF63SDC4 lyrp0CnUmNkuEihwtZ4jdn8NBi546cHo5TC3R3x6jTwR4mMWQ8ntZG/F9NAHd3HdUzcnJaS8d V7riSAOfAOpEFon9LuDOW07LU3sM1Jw1aQLpwCwYZZkAkrG/qOsiKGv3vNsTDMK9pRLFyfhsp Fy9rJ+UtqnCQL4FBb7A7a3krBz6kUe32OZmaLlWCE9D16WSSSqvAsUJkS8cnVe5POC/smtk7Q 3cg/FgY4EIiSikz7AArfZh8DfpoLX7sXsvL5xj3qc+ViJfDCQD6YCIKrH41OChV+nydIaHljj svP+oAvf0jlsfPE+8uSjMzmupDZV5YpP3d/Rq3YW3j5R1lhwTZOJtZK2itCHuZ27BEBYM5oRv 4UqqXud5GaxYBcfCz1YfT6/Aj7NDubsvZK2JBh1dKQ5aPtAuruCdl1qM8kajM1xeGxJ5f2+eQ Hx0vLDcSC29M0ZcJj+AacikCgP+ygG1BI91zPxIfqkvmCkYznI0Hr6XZDsGoiDzKnKE7CiBci v+hkm2ILHFHbcPLFOBxxnmr0qyMZiYN9yQqoE/6uvIFr33YDXxiIhQJEU9ZMLWex3aG5F4vRA 24gqzP1CVD7vckPH/w6j76UYn3q/APOldzBSWAuoWeE6wjy95v6ribau69VZamWwGYzTGhObL ns5LEr4fyROnU/uCWNT+/ZoUXqRVHNzDqFx7GDuApTUSiGeOYXKLznqpSmzQVuBSlXa4EfBFO 2wOmW8fYnL7sMARqFMplNX2JvuK2KflcaOvjxyCgJH449uH6xU= 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: Wed, 31 Jan 2018 21:36:53 +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/iio/gyro/hid-sensor-gyro-3d.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c index f59995a90387..93465816c5c7 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c @@ -317,10 +317,8 @@ static int hid_gyro_3d_probe(struct platform_device *pdev) indio_dev->channels = kmemdup(gyro_3d_channels, sizeof(gyro_3d_channels), GFP_KERNEL); - if (!indio_dev->channels) { - dev_err(&pdev->dev, "failed to duplicate channels\n"); + if (!indio_dev->channels) return -ENOMEM; - } ret = gyro_3d_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels,