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 2/3] uio: Return directly after a failed kzalloc() in uio_dmem_genirq_probe()
Date: Wed, 6 Dec 2017 19:37:14 +0100 [thread overview]
Message-ID: <b6158483-3ace-d787-87f2-7ff51c889dc9@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:11:49 +0100
* Return directly after a call of the function "kzalloc" failed
in an if branch.
* Delete the jump label "bad2" which became unnecessary with
this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/uio/uio_dmem_genirq.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c
index b7b0acd1bf01..4f230ce8b861 100644
--- a/drivers/uio/uio_dmem_genirq.c
+++ b/drivers/uio/uio_dmem_genirq.c
@@ -158,10 +158,9 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
/* alloc uioinfo for one device */
uioinfo = kzalloc(sizeof(*uioinfo), GFP_KERNEL);
- if (!uioinfo) {
- ret = -ENOMEM;
- goto bad2;
- }
+ if (!uioinfo)
+ return -ENOMEM;
+
uioinfo->name = pdev->dev.of_node->name;
uioinfo->version = "devicetree";
@@ -285,7 +284,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
/* kfree uioinfo for OF */
if (pdev->dev.of_node)
kfree(uioinfo);
- bad2:
+
return ret;
}
--
2.15.1
next prev parent reply other threads:[~2017-12-06 18:37 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 ` SF Markus Elfring [this message]
2017-12-06 18:38 ` [PATCH 3/3] uio: Delete two error messages for a failed memory allocation in uio_pdrv_genirq_probe() SF Markus Elfring
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=b6158483-3ace-d787-87f2-7ff51c889dc9@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