aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can/mscan
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2009-11-16 07:57:53 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-17 06:54:05 -0500
commit323907ac72a223ed4e4d67ce8e3589900023a0c8 (patch)
treec186a27332acbcdc9a3fc9ad1231066eab1b4179 /drivers/net/can/mscan
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/can/mscan')
-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 263d1a9f0880..bb06dfb58f25 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)
542 542
543 ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev); 543 ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev);
544 if (ret < 0) { 544 if (ret < 0) {
545 napi_disable(&priv->napi); 545 dev_err(dev->dev.parent, "failed to attach interrupt\n");
546 printk(KERN_ERR "%s - failed to attach interrupt\n", 546 goto exit_napi_disable;
547 dev->name);
548 return ret;
549 } 547 }
550 548
551 priv->open_time = jiffies; 549 priv->open_time = jiffies;
@@ -554,11 +552,19 @@ static int mscan_open(struct net_device *dev)
554 552
555 ret = mscan_start(dev); 553 ret = mscan_start(dev);
556 if (ret) 554 if (ret)
557 return ret; 555 goto exit_free_irq;
558 556
559 netif_start_queue(dev); 557 netif_start_queue(dev);
560 558
561 return 0; 559 return 0;
560
561exit_free_irq:
562 priv->open_time = 0;
563 free_irq(dev->irq, dev);
564exit_napi_disable:
565 napi_disable(&priv->napi);
566 close_candev(dev);
567 return ret;
562} 568}
563 569
564static int mscan_close(struct net_device *dev) 570static int mscan_close(struct net_device *dev)