[PATCH 3.4 28/35] can: flexcan: flexcan_open(): fix error path if flexcan_chip_start() fails

From: Greg Kroah-Hartman
Date: Thu Mar 20 2014 - 20:16:21 EST


3.4-stable review patch. If anyone has any objections, please let me know.

------------------

From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/net/can/flexcan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -805,7 +805,7 @@ static int flexcan_open(struct net_devic

err = request_irq(dev->irq, flexcan_irq, IRQF_SHARED, dev->name, dev);
if (err)
- goto out_close;
+ goto out_free_irq;

/* start chip and queuing */
err = flexcan_chip_start(dev);
@@ -816,6 +816,8 @@ static int flexcan_open(struct net_devic

return 0;

+ out_free_irq:
+ free_irq(dev->irq, dev);
out_close:
close_candev(dev);
out:


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/