Skip to contentSkip to conversation

img-ir: Delete an error message for a failed memory allocation in img_ir_probe()

PATCH New SF Markus Elfring 1 participant 1 message Aug 29, 2017

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

PATCH 1/1 img-ir: Delete an error message for a failed memory allocation in img_ir_probe()

From: Markus Elfring <[email protected]>
Date: Tue, 29 Aug 2017 21:04:20 +0200

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

This issue was detected by using the Coccinelle software.

---
 drivers/media/rc/img-ir/img-ir-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/rc/img-ir/img-ir-core.c +2 -3
index 03fe080278df..bcbabeeab12a 100644
@@ -92,10 +92,9 @@ static int img_ir_probe(struct platform_device *pdev)
 
 	/* Private driver data */
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv) {
-		dev_err(&pdev->dev, "cannot allocate device data\n");
+	if (!priv)
 		return -ENOMEM;
-	}
+
 	platform_set_drvdata(pdev, priv);
 	priv->dev = &pdev->dev;
 	spin_lock_init(&priv->lock);
Signature · 1 line
2.14.1