[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1258412274-14686-11-git-send-email-w.sang@pengutronix.de>
Date: Mon, 16 Nov 2009 23:57:53 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: netdev@...r.kernel.org
Cc: linuxppc-dev@...abs.org, socketcan-core@...ts.berlios.de,
David Miller <davem@...emloft.net>,
Grant Likely <grant.likely@...retlab.ca>, wg@...ndegger.com,
Wolfram Sang <w.sang@...gutronix.de>
Subject: [PATCH 10/11] net/can/mscan: add error path to mscan_open()
Signed-off-by: Wolfram Sang <w.sang@...gutronix.de>
---
drivers/net/can/mscan/mscan.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index 263d1a9..bb06dfb 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)
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists