[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <0406765c-bdd1-1a82-cf66-1c248063ae4f@users.sourceforge.net>
Date: Wed, 31 Jan 2018 22:26:14 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-iio@...r.kernel.org, linux-input@...r.kernel.org,
Hartmut Knaack <knaack.h@....de>,
Jiri Kosina <jikos@...nel.org>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH] hid-sensor-accel-3d: Delete an error message for a failed
memory allocation in hid_accel_3d_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 31 Jan 2018 22:20:56 +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 <elfring@...rs.sourceforge.net>
---
drivers/iio/accel/hid-sensor-accel-3d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index c066a3bdbff7..3d0acde40285 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -383,11 +383,9 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
return ret;
}
indio_dev->channels = kmemdup(channel_spec, channel_size, GFP_KERNEL);
-
- if (!indio_dev->channels) {
- dev_err(&pdev->dev, "failed to duplicate channels\n");
+ if (!indio_dev->channels)
return -ENOMEM;
- }
+
ret = accel_3d_parse_report(pdev, hsdev,
(struct iio_chan_spec *)indio_dev->channels,
hsdev->usage, accel_state);
--
2.16.1
Powered by blists - more mailing lists