[TG3]: Fix a memory leak.
authorAdrian Bunk <bunk@stusta.de>
Thu, 6 Apr 2006 05:21:04 +0000 (22:21 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 10 Apr 2006 05:25:27 +0000 (22:25 -0700)
This patch fixes a memory leak (buf wasn't freed) spotted by the
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c

index 0b5358072172a9f0c95d008ea21447aa59ca0595..d6047bd6805d44b62a9a7f6d2e676776ca6575df 100644 (file)
@@ -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 */