Skip to contentSkip to conversation

hid-sensor-gyro-3d: Delete an error message for a failed memory allocation in hid_gyro_3d_probe()

PATCH New SF Markus Elfring 1 participant 1 message Jan 31, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hid-sensor-gyro-3d: Delete an error message for a failed memory allocation in hid_gyro_3d_probe()

From: Markus Elfring <[email protected]>
Date: Wed, 31 Jan 2018 21:36:53 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/iio/gyro/hid-sensor-gyro-3d.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/gyro/hid-sensor-gyro-3d.c +1 -3
index f59995a90387..93465816c5c7 100644
@@ -317,10 +317,8 @@ static int hid_gyro_3d_probe(struct platform_device *pdev)
 
 	indio_dev->channels = kmemdup(gyro_3d_channels,
 				      sizeof(gyro_3d_channels), GFP_KERNEL);
-	if (!indio_dev->channels) {
-		dev_err(&pdev->dev, "failed to duplicate channels\n");
+	if (!indio_dev->channels)
 		return -ENOMEM;
-	}
 
 	ret = gyro_3d_parse_report(pdev, hsdev,
 				   (struct iio_chan_spec *)indio_dev->channels,
Signature · 1 line
2.16.1