summaryrefslogtreecommitdiff
path: root/drivers/char/hw_random/bcm2835-rng.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2016-08-29 20:10:16 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2016-09-07 16:08:24 +0300
commitda59c51cf2201b6b242bdea320fcfe7b8d331900 (patch)
treeaa84ac751e9ec501c5b6aa3f7facd4e80e14b5ee /drivers/char/hw_random/bcm2835-rng.c
parent10faa8c0d6c3b22466f97713a9533824a2ea1c57 (diff)
downloadlinux-da59c51cf2201b6b242bdea320fcfe7b8d331900.tar.xz
hwrng: bcm2835 - handle of_iomap failures
Check return value of of_iomap and handle errors correctly. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random/bcm2835-rng.c')
-rw-r--r--drivers/char/hw_random/bcm2835-rng.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index af2149273fe0..574211a49549 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)