summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2009-11-16 12:57:53 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-17 03:54:05 -0800
commit323907ac72a223ed4e4d67ce8e3589900023a0c8 (patch)
treec186a27332acbcdc9a3fc9ad1231066eab1b4179 /drivers/net
parent74ff60b29ec602322178d32cb2a82b24ddb884fc (diff)
net/can/mscan: add error path to mscan_open()
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/can/mscan/mscan.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index 263d1a9f088..bb06dfb58f2 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -542,10 +542,8 @@ static int mscan_open(struct net_device *dev)
ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev);
if (ret < 0) {
- napi_disable(&priv->napi);
- printk(KERN_ERR "%s - failed to attach interrupt\n",
- dev->name);
- return ret;
+ dev_err(dev->dev.parent, "failed to attach interrupt\n");
+ goto exit_napi_disable;
}
priv->open_time = jiffies;
@@ -554,11 +552,19 @@ static int mscan_open(struct net_device *dev)
ret = mscan_start(dev);
if (ret)
- return ret;
+ goto exit_free_irq;
netif_start_queue(dev);
return 0;
+
+exit_free_irq:
+ priv->open_time = 0;
+ free_irq(dev->irq, dev);
+exit_napi_disable:
+ napi_disable(&priv->napi);
+ close_candev(dev);
+ return ret;
}
static int mscan_close(struct net_device *dev)