提交 d7027aaa 编写于 作者: H Hans Verkuil 提交者: Zheng Zengkai

media: gspca/sq905.c: fix uninitialized variable

stable inclusion
from stable-5.10.36
commit 80ba39ec7cc9b8683dc9c0b6943d2861c3e9be56
bugzilla: 51867
CVE: NA

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

[ Upstream commit eaaea468 ]

act_len can be uninitialized if usb_bulk_msg() returns an error.
Set it to 0 to avoid a KMSAN error.
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+a4e309017a5f3a24c7b3@syzkaller.appspotmail.com
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 1c491af7
...@@ -158,7 +158,7 @@ static int ...@@ -158,7 +158,7 @@ static int
sq905_read_data(struct gspca_dev *gspca_dev, u8 *data, int size, int need_lock) sq905_read_data(struct gspca_dev *gspca_dev, u8 *data, int size, int need_lock)
{ {
int ret; int ret;
int act_len; int act_len = 0;
gspca_dev->usb_buf[0] = '\0'; gspca_dev->usb_buf[0] = '\0';
if (need_lock) if (need_lock)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册