netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
	kernel@pengutronix.de, Marc Kleine-Budde <mkl@pengutronix.de>,
	linux-stable <stable@vger.kernel.org>
Subject: [PATCH 2/8] can: flexcan: flexcan_open(): fix error path if flexcan_chip_start() fails
Date: Mon,  3 Mar 2014 14:54:29 +0100	[thread overview]
Message-ID: <1393854875-8171-3-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1393854875-8171-1-git-send-email-mkl@pengutronix.de>

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>
---
 drivers/net/can/flexcan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index dcd69c9..30af702 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -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);
 
@@ -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:
-- 
1.9.0

  parent reply	other threads:[~2014-03-03 13:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 13:54 pull-request: can 2014-03-03 Marc Kleine-Budde
2014-03-03 13:54 ` [PATCH 1/8] can: flexcan: fix shutdown: first disable chip, then all interrupts Marc Kleine-Budde
2014-03-03 13:54 ` Marc Kleine-Budde [this message]
2014-03-03 13:54 ` [PATCH 3/8] can: flexcan: fix transition from and to low power mode in chip_{en,dis}able Marc Kleine-Budde
2014-03-03 13:54 ` [PATCH 4/8] can: flexcan: factor out transceiver {en,dis}able into seperate functions Marc Kleine-Budde
2014-03-03 13:54 ` [PATCH 5/8] can: flexcan: fix transition from and to freeze mode in chip_{,un}freeze Marc Kleine-Budde
2014-03-03 13:54 ` [PATCH 6/8] can: flexcan: flexcan_remove(): add missing netif_napi_del() Marc Kleine-Budde
2014-03-03 13:54 ` [PATCH 7/8] can: flexcan: factor out soft reset into seperate funtion Marc Kleine-Budde
2014-03-03 13:54 ` [PATCH 8/8] can: remove CAN FD compatibility for CAN 2.0 sockets Marc Kleine-Budde
2014-03-03 21:05 ` pull-request: can 2014-03-03 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393854875-8171-3-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).