提交 d34add05 编写于 作者: C Christian Engelmayer 提交者: Greg Kroah-Hartman

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: NChristian Engelmayer <cengelma@gmx.at>
Reviewed-by: NMartin Kepplinger <martink@posteo.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6498613d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册