diff options
author | Christian Engelmayer <cengelma@gmx.at> | 2015-02-11 20:33:15 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-06 16:26:58 -0800 |
commit | d34add05946ffda90ad5c4f0f71af2819748c660 (patch) | |
tree | 6746a1d6e93457bb7ecdf32e5c2a62913abd3ae6 /drivers/staging/vt6656 | |
parent | 6498613d2cf23269a6a483a751f61655115de251 (diff) | |
download | op-kernel-dev-d34add05946ffda90ad5c4f0f71af2819748c660.zip op-kernel-dev-d34add05946ffda90ad5c4f0f71af2819748c660.tar.gz |
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 <cengelma@gmx.at>
Reviewed-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/firmware.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c index a177645..d440f28 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); |