Skip to content

Commit

Permalink
media: gspca/sq905.c: fix uninitialized variable
Browse files Browse the repository at this point in the history
act_len can be uninitialized if usb_bulk_msg() returns an error.
Set it to 0 to avoid a KMSAN error.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+a4e309017a5f3a24c7b3@syzkaller.appspotmail.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Hans Verkuil authored and mchehab committed Mar 22, 2021
1 parent 48e1541 commit eaaea46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/usb/gspca/sq905.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static int
sq905_read_data(struct gspca_dev *gspca_dev, u8 *data, int size, int need_lock)
{
int ret;
int act_len;
int act_len = 0;

gspca_dev->usb_buf[0] = '\0';
if (need_lock)
Expand Down

0 comments on commit eaaea46

Please sign in to comment.