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>
This commit is contained in:
parent
ba1142e4fb
commit
5bc09186de
1 changed files with 4 additions and 5 deletions
|
@ -9677,14 +9677,13 @@ static int tg3_open(struct net_device *dev)
|
||||||
struct tg3_napi *tnapi = &tp->napi[i];
|
struct tg3_napi *tnapi = &tp->napi[i];
|
||||||
err = tg3_request_irq(tp, i);
|
err = tg3_request_irq(tp, i);
|
||||||
if (err) {
|
if (err) {
|
||||||
for (i--; i >= 0; i--)
|
for (i--; i >= 0; i--) {
|
||||||
|
tnapi = &tp->napi[i];
|
||||||
free_irq(tnapi->irq_vec, tnapi);
|
free_irq(tnapi->irq_vec, tnapi);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (err)
|
|
||||||
goto err_out2;
|
goto err_out2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tg3_full_lock(tp, 0);
|
tg3_full_lock(tp, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue