Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa617521 authored by Hans Verkuil's avatar Hans Verkuil Committed by Greg Kroah-Hartman
Browse files

media: gspca/sq905.c: fix uninitialized variable



[ Upstream commit eaaea4681984c79d2b2b160387b297477f0c1aab ]

act_len can be uninitialized if usb_bulk_msg() returns an error.
Set it to 0 to avoid a KMSAN error.

Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: default avatar <syzbot+a4e309017a5f3a24c7b3@syzkaller.appspotmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 423ce580
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -167,7 +167,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)