iio/light: Delete an error message for a failed memory allocation in two functions
Subsystems (4)
PATCH 1/1 iio/light: Delete an error message for a failed memory allocation in two functions
From: Markus Elfring <[email protected]>
Date: Wed, 31 Jan 2018 21:12:09 +0100
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/iio/light/hid-sensor-als.c | 4 +--- drivers/iio/light/hid-sensor-prox.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/iio/light/hid-sensor-als.c +1 -3
@@ -299,10 +299,8 @@ static int hid_als_probe(struct platform_device *pdev) indio_dev->channels =kmemdup (als_channels,sizeof (als_channels),GFP_KERNEL ); -if (!indio_dev->channels) { -dev_err (&pdev->dev,"failed to duplicate channels\n" ); +if (!indio_dev->channels)return -ENOMEM ; - } ret = als_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels,
drivers/iio/light/hid-sensor-prox.c +1 -3
@@ -277,10 +277,8 @@ static int hid_prox_probe(struct platform_device *pdev) indio_dev->channels =kmemdup (prox_channels,sizeof (prox_channels),GFP_KERNEL ); -if (!indio_dev->channels) { -dev_err (&pdev->dev,"failed to duplicate channels\n" ); +if (!indio_dev->channels)return -ENOMEM ; - } ret = prox_parse_report(pdev, hsdev, (struct iio_chan_spec *)indio_dev->channels,
Signature · 1 line
2.16.1