[PATCH 3.5 14/71] can: flexcan: flexcan_open(): fix error path if flexcan_chip_start() fails
Luis Henriques
luis.henriques at canonical.com
Mon Mar 31 13:22:20 UTC 2014
3.5.7.33 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <mkl at pengutronix.de>
commit 7e9e148af01ef388efb6e2490805970be4622792 upstream.
If flexcan_chip_start() in flexcan_open() fails, the interrupt is not freed,
this patch adds the missing cleanup.
Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/net/can/flexcan.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 95109eb..8a5911f 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -813,12 +813,15 @@ static int flexcan_open(struct net_device *dev)
/* start chip and queuing */
err = flexcan_chip_start(dev);
if (err)
- goto out_close;
+ goto out_free_irq;
+
napi_enable(&priv->napi);
netif_start_queue(dev);
return 0;
+ out_free_irq:
+ free_irq(dev->irq, dev);
out_close:
close_candev(dev);
out:
--
1.9.1
More information about the kernel-team
mailing list