[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1320316603-8355-1-git-send-email-akinobu.mita@gmail.com>
Date: Thu, 3 Nov 2011 19:36:43 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: netdev@...r.kernel.org
Cc: Akinobu Mita <akinobu.mita@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Matt Carlson <mcarlson@...adcom.com>,
Michael Chan <mchan@...adcom.com>
Subject: [PATCH] tg3: fix error handling in tg3_open
If one of the request_irq calls fails in tg3_open, all interrupts
allocated with request_irq should be freed before returning error.
But it accidentally attempts to free the same invalid IRQ repeatedly.
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Matt Carlson <mcarlson@...adcom.com>
Cc: Michael Chan <mchan@...adcom.com>
Cc: netdev@...r.kernel.org
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
---
drivers/net/ethernet/broadcom/tg3.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 161cbbb..13c4054 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -9674,8 +9674,10 @@ static int tg3_open(struct net_device *dev)
struct tg3_napi *tnapi = &tp->napi[i];
err = tg3_request_irq(tp, i);
if (err) {
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--) {
+ tnapi = &tp->napi[i];
free_irq(tnapi->irq_vec, tnapi);
+ }
break;
}
}
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists