iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe()
Subsystems (4)
PATCH 1/1 iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe()
From: Markus Elfring <[email protected]>
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 <[email protected]>
--- drivers/iio/pressure/hid-sensor-press.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/pressure/hid-sensor-press.c +1 -3
@@ -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,
Signature · 1 line
2.16.1
Jonathan Cameron
maintainerQuoted 8 lines · On Mon, 29 Jan 2018 22:04:11 +0100 SF Markus Elfring…
From: Markus Elfring <[email protected]>
Date: Mon, 29 Jan 2018 21:55:08 +0100Omit 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 <[email protected]>
Whilst the error message doesn't add a lot, it does add some information over a simple memory copy failed error.
Hence I think we should keep it.
Jonathan
Quoted 20 lines
--- drivers/iio/pressure/hid-sensor-press.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/iio/pressure/hid-sensor-press.c +1
-3@@ -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,