mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] drivers/base: bail out if request_iomem_region fails
@ 2012-06-27 13:56 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2012-06-27 13:56 UTC (permalink / raw)
  To: barebox

When request_iomem_region fails we have to bail out instead of
dereferencing res->start.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/base/driver.c |    2 ++
 1 file changed, 2 insertions(+)

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;
 }
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-27 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 13:56 [PATCH] drivers/base: bail out if request_iomem_region fails Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox