From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, lee@kernel.org,
eric@anholt.net, yendapally.reddy@broadcom.com
Cc: linux-crypto@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, mpm@selenic.com,
herbert@gondor.apana.org.au,
Arvind Yadav <arvind.yadav.cs@gmail.com>
Subject: [PATCH] char: hw_random: bcm2835: handle of_iomap failures in bcm2835 driver
Date: Mon, 29 Aug 2016 22:40:16 +0530 [thread overview]
Message-ID: <1472490616-9597-1-git-send-email-arvind.yadav.cs@gmail.com> (raw)
Check return value of of_iomap and handle errors correctly.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/char/hw_random/bcm2835-rng.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index af21492..574211a 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -92,9 +92,10 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
bcm2835_rng_ops.priv = (unsigned long)rng_base;
rng_id = of_match_node(bcm2835_rng_of_match, np);
- if (!rng_id)
+ if (!rng_id) {
+ iounmap(rng_base);
return -EINVAL;
-
+ }
/* Check for rng init function, execute it */
rng_setup = rng_id->data;
if (rng_setup)
--
2.7.4
next reply other threads:[~2016-08-29 17:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-29 17:10 Arvind Yadav [this message]
2016-08-30 18:26 ` [PATCH] char: hw_random: bcm2835: handle of_iomap failures in bcm2835 driver Eric Anholt
2016-09-07 13:19 ` Herbert Xu
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=1472490616-9597-1-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mpm@selenic.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=yendapally.reddy@broadcom.com \
/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