Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1722715 > unrolled thread

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

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-08-29 21:10 +0200
Last post2017-08-29 21:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] [media] img-ir: Delete an error message for a failed memory  allocation in img_ir_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-29 21:10 +0200

#1722715 — [PATCH] [media] img-ir: Delete an error message for a failed memory allocation in img_ir_probe()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-08-29 21:10 +0200
Subject[PATCH] [media] img-ir: Delete an error message for a failed memory allocation in img_ir_probe()
Message-ID<ujU3F-6AB-39@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/rc/img-ir/img-ir-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/rc/img-ir/img-ir-core.c b/drivers/media/rc/img-ir/img-ir-core.c
index 03fe080278df..bcbabeeab12a 100644
--- a/drivers/media/rc/img-ir/img-ir-core.c
+++ b/drivers/media/rc/img-ir/img-ir-core.c
@@ -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);
-- 
2.14.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web