diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2011-11-04 05:15:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-04 17:31:47 -0400 |
commit | 5bc09186deba2a016b60aa3923fc0e42838ce877 (patch) | |
tree | e16110c073141e90e5f679fd2f385d8e1278e47b /drivers/net/ethernet | |
parent | ba1142e4fb291c7bf124d93596351dca8d226a0f (diff) |
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.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Ben Li <benli@broadcom.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 3a7517910eed..0413e1e85641 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -9677,15 +9677,14 @@ static int tg3_open(struct net_device *dev) | |||
9677 | struct tg3_napi *tnapi = &tp->napi[i]; | 9677 | struct tg3_napi *tnapi = &tp->napi[i]; |
9678 | err = tg3_request_irq(tp, i); | 9678 | err = tg3_request_irq(tp, i); |
9679 | if (err) { | 9679 | if (err) { |
9680 | for (i--; i >= 0; i--) | 9680 | for (i--; i >= 0; i--) { |
9681 | tnapi = &tp->napi[i]; | ||
9681 | free_irq(tnapi->irq_vec, tnapi); | 9682 | free_irq(tnapi->irq_vec, tnapi); |
9682 | break; | 9683 | } |
9684 | goto err_out2; | ||
9683 | } | 9685 | } |
9684 | } | 9686 | } |
9685 | 9687 | ||
9686 | if (err) | ||
9687 | goto err_out2; | ||
9688 | |||
9689 | tg3_full_lock(tp, 0); | 9688 | tg3_full_lock(tp, 0); |
9690 | 9689 | ||
9691 | err = tg3_init_hw(tp, 1); | 9690 | err = tg3_init_hw(tp, 1); |