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)
committerJiri Slaby <jslaby@suse.cz>
Mon, 24 Mar 2014 08:45:01 +0000 (09:45 +0100)
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: Jiri Slaby <jslaby@suse.cz>
drivers/net/can/flexcan.c

index 26c8b2d..ba7a554 100644 (file)
@@ -865,7 +865,7 @@ 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;
 
        can_led_event(dev, CAN_LED_EVENT_OPEN);
 
@@ -874,6 +874,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_disable_per: