aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-03-11 15:46:40 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-03-22 11:55:48 +0100
commiteaaea4681984c79d2b2b160387b297477f0c1aab (patch)
treedd86066cdab4de81da0d18755083dff8e9c52b7d /drivers/media/usb
parentmedia: v4l2-ioctl.c: fix timestamp format (diff)
downloadlinux-dev-eaaea4681984c79d2b2b160387b297477f0c1aab.tar.xz
linux-dev-eaaea4681984c79d2b2b160387b297477f0c1aab.zip
media: gspca/sq905.c: fix uninitialized variable
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>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/gspca/sq905.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/gspca/sq905.c b/drivers/media/usb/gspca/sq905.c
index 97799cfb832e..949111070971 100644
--- a/drivers/media/usb/gspca/sq905.c
+++ b/drivers/media/usb/gspca/sq905.c
@@ -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)