Skip to contentSkip to conversation

tg3: Fix irq alloc error cleanup path

PATCH In review Matt Carlson 1 participant 1 message Nov 4, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 4/8 tg3: Fix irq alloc error cleanup path

This patch fixes a bug where the irq error cleanup path did not free all the resources it allocated.

---
 drivers/net/ethernet/broadcom/tg3.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +4 -5
index 3a75179..0413e1e 100644
@@ -9677,15 +9677,14 @@ 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;
+			}
+			goto err_out2;
 		}
 	}
 
-	if (err)
-		goto err_out2;
-
 	tg3_full_lock(tp, 0);
 
 	err = tg3_init_hw(tp, 1);
Signature · 1 line
1.7.3.4