Skip to content

Commit

Permalink
can: flexcan: flexcan_open(): fix error path if flexcan_chip_start() …
Browse files Browse the repository at this point in the history
…fails

If flexcan_chip_start() in flexcan_open() fails, the interrupt is not freed,
this patch adds the missing cleanup.

Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Marc Kleine-Budde committed Mar 3, 2014
1 parent 5be93bd commit 7e9e148
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/can/flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,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);

Expand All @@ -877,6 +877,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:
Expand Down

0 comments on commit 7e9e148

Please sign in to comment.