Skip to content

Commit

Permalink
tg3: Fix irq alloc error cleanup path
Browse files Browse the repository at this point in the history
This patch fixes a bug where the irq error cleanup path did not free all
the resources it allocated.

Signed-off-by: Matt Carlson <[email protected]>
Signed-off-by: Ben Li <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Reviewed-by: Michael Chan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Matt Carlson authored and davem330 committed Nov 4, 2011
1 parent ba1142e commit 5bc0918
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5bc0918

Please sign in to comment.