linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe()
@ 2018-01-29 21:04 SF Markus Elfring
       [not found] ` <e7dfe444-616a-e156-31d5-8ed626434d1f-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: SF Markus Elfring @ 2018-01-29 21:04 UTC (permalink / raw)
  To: linux-iio, linux-input, Archana Patni, 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: Mon, 29 Jan 2018 21:55:08 +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/pressure/hid-sensor-press.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
index 4c437918f1d2..9de7590d50b0 100644
--- a/drivers/iio/pressure/hid-sensor-press.c
+++ b/drivers/iio/pressure/hid-sensor-press.c
@@ -280,10 +280,8 @@ static int hid_press_probe(struct platform_device *pdev)
 
 	indio_dev->channels = kmemdup(press_channels, sizeof(press_channels),
 				      GFP_KERNEL);
-	if (!indio_dev->channels) {
-		dev_err(&pdev->dev, "failed to duplicate channels\n");
+	if (!indio_dev->channels)
 		return -ENOMEM;
-	}
 
 	ret = press_parse_report(pdev, hsdev,
 				 (struct iio_chan_spec *)indio_dev->channels,
-- 
2.16.1

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-29 21:04 [PATCH] iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe() SF Markus Elfring
     [not found] ` <e7dfe444-616a-e156-31d5-8ed626434d1f-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2018-02-04 10:58   ` Jonathan Cameron

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).