summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-06-27 15:15:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-06-27 18:31:34 +0200
commita6e358b2f5b219fda18a7bc9348cb969043c19d5 (patch)
treeb8d758d75aa77c1967fcf003f90841797e39bd1e
parentfd4c51aa28acfd61e1802cb5ab1197d808e7da82 (diff)
downloadbarebox-a6e358b2f5b219fda18a7bc9348cb969043c19d5.tar.gz
drivers/base: bail out if request_iomem_region fails
When request_iomem_region fails we have to bail out instead of dereferencing res->start. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/base/driver.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 3be4b99..81cedca 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -262,6 +262,8 @@ void __iomem *dev_request_mem_region(struct device_d *dev, int num)
return NULL;
res = request_iomem_region(dev_name(dev), res->start, res->size);
+ if (!res)
+ return NULL;
return (void __force __iomem *)res->start;
}