can: flexcan: flexcan_open(): fix error path if flexcan_chip_start() fails
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 28 Feb 2014 13:52:01 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Mar 2014 04:37:07 +0000 (21:37 -0700)
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@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/flexcan.c

index eb4014a25d3c52db216eae70cdc948098c4b448e..75e9233aabafc9c7b98d5f277a8086eb20d3f952 100644 (file)
@@ -805,7 +805,7 @@ static int flexcan_open(struct net_device *dev)
 
        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_device *dev)
 
        return 0;
 
+ out_free_irq:
+       free_irq(dev->irq, dev);
  out_close:
        close_candev(dev);
  out: