summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2014-07-31 19:11:32 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2014-08-01 07:35:51 +0200
commit2145a2c0ba0de1299ab23b1c9e643e0fc1d2b704 (patch)
treed4c0a79a121a1be484c465edee468ef650c8ec5f /drivers/watchdog
parentb549a26fc3088b85602caf412bebd16f9e3e8ae9 (diff)
downloadbarebox-2145a2c0ba0de1299ab23b1c9e643e0fc1d2b704.tar.gz
watchdog: i.MX: check requested mem region in imx_wd_probe()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/imxwd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index 63c5605..31c3d0d 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -159,6 +159,10 @@ static int imx_wd_probe(struct device_d *dev)
priv = xzalloc(sizeof(struct imx_wd));
priv->base = dev_request_mem_region(dev, 0);
+ if (!priv->base) {
+ dev_err(dev, "could not get memory region\n");
+ return -ENODEV;
+ }
priv->set_timeout = fn;
priv->wd.set_timeout = imx_watchdog_set_timeout;
priv->dev = dev;