diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-31 10:38:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-09-16 08:32:10 +0200 |
commit | ed6e965824303255cacc1c1a195d3684caa26bce (patch) | |
tree | 26e2b1b78498675ceae4dd2e990836c26ec1d5ec /drivers/watchdog/im28wd.c | |
parent | 5bdc82c54a3306f2ae151a00f2df54f9240395b8 (diff) | |
download | barebox-ed6e965824303255cacc1c1a195d3684caa26bce.tar.gz barebox-ed6e965824303255cacc1c1a195d3684caa26bce.tar.xz |
resource: Let dev_request_mem_region return an error pointer
For all users fix or add the error check.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/watchdog/im28wd.c')
-rw-r--r-- | drivers/watchdog/im28wd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/watchdog/im28wd.c b/drivers/watchdog/im28wd.c index dd66e12fc0..3e73ecd62e 100644 --- a/drivers/watchdog/im28wd.c +++ b/drivers/watchdog/im28wd.c @@ -22,6 +22,7 @@ #include <malloc.h> #include <watchdog.h> #include <reset_source.h> +#include <linux/err.h> #define MXS_RTC_CTRL 0x0 #define MXS_RTC_SET_ADDR 0x4 @@ -186,6 +187,8 @@ static int imx28_wd_probe(struct device_d *dev) priv = xzalloc(sizeof(struct imx28_wd)); priv->regs = dev_request_mem_region(dev, 0); + if (IS_ERR(priv->regs)) + return PTR_ERR(priv->regs); priv->wd.set_timeout = imx28_watchdog_set_timeout; if (!(readl(priv->regs + MXS_RTC_STAT) & MXS_RTC_STAT_WD_PRESENT)) { |