[PATCH 2/2] net: dm9k: bail out when resources can't be claimed

Sascha Hauer s.hauer at pengutronix.de
Wed Dec 18 10:45:15 EST 2013


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/net/dm9k.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/dm9k.c b/drivers/net/dm9k.c
index 090482c..4c28870 100644
--- a/drivers/net/dm9k.c
+++ b/drivers/net/dm9k.c
@@ -722,7 +722,11 @@ static int dm9k_probe(struct device_d *dev)
 
 	priv->buswidth = dev->resource[0].flags & IORESOURCE_MEM_TYPE_MASK;
 	priv->iodata = dev_request_mem_region(dev, 1);
+	if (!priv->iodata)
+		return -EBUSY;
 	priv->iobase = dev_request_mem_region(dev, 0);
+	if (!priv->iobase)
+		return -EBUSY;
 	priv->srom = pdata->srom;
 
 	edev->init = dm9k_init_dev;
-- 
1.8.5.1




More information about the barebox mailing list