From: Adrian Bunk Date: Thu, 6 Apr 2006 05:21:04 +0000 (-0700) Subject: [TG3]: Fix a memory leak. X-Git-Tag: v2.6.17-rc2~291^2~28 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ad96b485b4224785bcca478cfba02d06c46ee575;p=linux-2.6-omap-h63xx.git [TG3]: Fix a memory leak. This patch fixes a memory leak (buf wasn't freed) spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 0b535807217..d6047bd6805 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -8034,9 +8034,13 @@ static int tg3_test_nvram(struct tg3 *tp) for (i = 0; i < size; i++) csum8 += buf8[i]; - if (csum8 == 0) - return 0; - return -EIO; + if (csum8 == 0) { + err = 0; + goto out; + } + + err = -EIO; + goto out; } /* Bootstrap checksum at offset 0x10 */