From: Dan Carpenter Date: Sat, 30 Jun 2012 12:07:55 +0000 (+0300) Subject: wlcore: fix a couple small memory leaks X-Git-Tag: firefly_0821_release~3680^2~2381^2~57^2~108 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f7ace5f044295a06a26cd1b4c176b011b0297ac4;p=firefly-linux-kernel-4.4.55.git wlcore: fix a couple small memory leaks We should free "chunk" here before returning the error code. Signed-off-by: Dan Carpenter Signed-off-by: Luciano Coelho --- diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c index 61113291a890..375ea574eafb 100644 --- a/drivers/net/wireless/ti/wlcore/boot.c +++ b/drivers/net/wireless/ti/wlcore/boot.c @@ -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 */