wlcore: fix a couple small memory leaks
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 30 Jun 2012 12:07:55 +0000 (15:07 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Jul 2012 16:10:15 +0000 (12:10 -0400)
We should free "chunk" here before returning the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/boot.c

index 61113291a89034cd94a1b62db2333dc7fe3a2be8..375ea574eafb3b7e09b936f8b24f9a1d04b21e19 100644 (file)
@@ -192,7 +192,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
        partition.mem.start = dest;
        ret = wlcore_set_partition(wl, &partition);
        if (ret < 0)
-               return ret;
+               goto out;
 
        /* 10.1 set partition limit and chunk num */
        chunk_num = 0;
@@ -208,7 +208,7 @@ static int wl1271_boot_upload_firmware_chunk(struct wl1271 *wl, void *buf,
                        partition.mem.start = addr;
                        ret = wlcore_set_partition(wl, &partition);
                        if (ret < 0)
-                               return ret;
+                               goto out;
                }
 
                /* 10.3 upload the chunk */