From d34add05946ffda90ad5c4f0f71af2819748c660 Mon Sep 17 00:00:00 2001 From: Christian Engelmayer Date: Wed, 11 Feb 2015 20:33:15 +0100 Subject: [PATCH] staging: vt6656: Fix possible leak in vnt_download_firmware() When failing to allocate buffer memory, function vnt_download_firmware() goes through the wrong exit path and fails to release the already requested firmware. Thus use the correct cleanup. Detected by Coverity CID 1269128. Signed-off-by: Christian Engelmayer Reviewed-by: Martin Kepplinger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6656/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c index a177645af83e..d440f284bf18 100644 --- a/drivers/staging/vt6656/firmware.c +++ b/drivers/staging/vt6656/firmware.c @@ -61,7 +61,7 @@ int vnt_download_firmware(struct vnt_private *priv) buffer = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL); if (!buffer) - goto out; + goto free_fw; for (ii = 0; ii < fw->size; ii += FIRMWARE_CHUNK_SIZE) { length = min_t(int, fw->size - ii, FIRMWARE_CHUNK_SIZE); -- 2.20.1