From: Matt Carlson Date: Fri, 4 Nov 2011 09:15:01 +0000 (+0000) Subject: tg3: Fix irq alloc error cleanup path X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~665 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0b68603cc1b2fac046314cd06ff1f206677b5293;p=users%2Fjedix%2Flinux-maple.git 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. (cherry picked from commit 5bc09186deba2a016b60aa3923fc0e42838ce877) Signed-off-by: Matt Carlson Signed-off-by: Ben Li Signed-off-by: Akinobu Mita Reviewed-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Joe Jin --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index a4a869cae453..9aa7689eef7e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -9685,15 +9685,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);