From: Arvind Yadav Date: Mon, 29 Aug 2016 17:10:16 +0000 (+0530) Subject: hwrng: bcm2835 - handle of_iomap failures X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=da59c51cf2201b6b242bdea320fcfe7b8d331900;p=linux-beck.git hwrng: bcm2835 - handle of_iomap failures Check return value of of_iomap and handle errors correctly. Signed-off-by: Arvind Yadav Acked-by: Eric Anholt Signed-off-by: Herbert Xu --- 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)