mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] uio: Delete two error messages for a failed memory allocation in uio_pdrv_genirq_probe()
Date: Wed, 6 Dec 2017 19:38:32 +0100	[thread overview]
Message-ID: <222016cb-fe56-0fe6-40b8-0cf77283e97c@users.sourceforge.net> (raw)
In-Reply-To: <2efe226c-065a-b77d-d278-4345ab2586b1@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 6 Dec 2017 19:18:12 +0100

Omit extra messages 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/uio/uio_pdrv_genirq.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index f598ecddc8a7..327fbe766f1c 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -114,10 +114,9 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
 		/* alloc uioinfo for one device */
 		uioinfo = devm_kzalloc(&pdev->dev, sizeof(*uioinfo),
 				       GFP_KERNEL);
-		if (!uioinfo) {
-			dev_err(&pdev->dev, "unable to kmalloc\n");
+		if (!uioinfo)
 			return -ENOMEM;
-		}
+
 		uioinfo->name = pdev->dev.of_node->name;
 		uioinfo->version = "devicetree";
 		/* Multiple IRQs are not supported */
@@ -135,10 +134,8 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
 	}
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv) {
-		dev_err(&pdev->dev, "unable to kmalloc\n");
+	if (!priv)
 		return -ENOMEM;
-	}
 
 	priv->uioinfo = uioinfo;
 	spin_lock_init(&priv->lock);
-- 
2.15.1

      parent reply	other threads:[~2017-12-06 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 18:34 [PATCH 0/3] UIO: Adjustments for two function implementations SF Markus Elfring
2017-12-06 18:35 ` [PATCH 1/3] uio: Delete two error messages for a failed memory allocation in uio_dmem_genirq_probe() SF Markus Elfring
2017-12-06 18:37 ` [PATCH 2/3] uio: Return directly after a failed kzalloc() " SF Markus Elfring
2017-12-06 18:38 ` SF Markus Elfring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=222016cb-fe56-0fe6-40b8-0cf77283e97c@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome