提交 cf6cc5a2 编写于 作者: N Navid Emamdoost 提交者: Xie XiuQi

media: usb: fix memory leak in af9005_identify_state

mainline inclusion
from mainline-v5.5
commit 2289adbfa559050d2a38bcd9caac1c18b800e928
category: bugfix
bugzilla: 13690
CVE: CVE-2019-18809

-------------------------------------------------

In af9005_identify_state when returning -EIO the allocated buffer should
be released. Replace the "return -EIO" with assignment into ret and move
deb_info() under a check.

Fixes: af4e067e ("V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech")
Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 aeb03295
......@@ -985,7 +985,8 @@ static int af9005_identify_state(struct usb_device *udev,
else if (reply == 0x02)
*cold = 0;
else
return -EIO;
ret = -EIO;
if (!ret)
deb_info("Identify state cold = %d\n", *cold);
err:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册