Skip to contentSkip to conversation

wlcore: fix a couple small memory leaks

PATCH In review Dan Carpenter 2 participants 2 messages Jun 30, 2012 – Jul 8, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wlcore: fix a couple small memory leaks

We should free "chunk" here before returning the error code.

drivers/net/wireless/ti/wlcore/boot.c +2 -2
index 8965960..48b2fee 100644
@@ -141,7 +141,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;
@@ -157,7 +157,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 */