linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hid-sensor-accel-3d: Delete an error message for a failed memory allocation in hid_accel_3d_probe()
@ 2018-01-31 21:26 SF Markus Elfring
  2018-02-04 11:23 ` Jonathan Cameron
  0 siblings, 1 reply; 10+ messages in thread
From: SF Markus Elfring @ 2018-01-31 21:26 UTC (permalink / raw)
  To: linux-iio, linux-input, Hartmut Knaack, Jiri Kosina,
	Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Srinivas Pandruvada
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.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@users.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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-10 18:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-31 21:26 [PATCH] hid-sensor-accel-3d: Delete an error message for a failed memory allocation in hid_accel_3d_probe() SF Markus Elfring
2018-02-04 11:23 ` Jonathan Cameron
2018-02-05 18:26   ` SF Markus Elfring
     [not found]     ` <9420fc82-1a37-3601-bafe-f57ef953bfcd-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2018-02-05 21:51       ` Jonathan Cameron
2018-02-06  8:45         ` Software evolution around “checkpatch.pl”? SF Markus Elfring
2018-02-10 14:53           ` Jonathan Cameron
2018-02-10 14:59             ` Joe Perches
     [not found]               ` <1518274783.6579.2.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2018-02-10 15:57                 ` Jonathan Cameron
2018-02-10 17:42                   ` Joe Perches
2018-02-10 18:30                     ` SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).