Skip to content

Commit ff6c914

Browse files
Hans Verkuilgregkh
authored andcommitted
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: Hans Verkuil <[email protected]> Reported-by: [email protected] Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5f15c0d commit ff6c914

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/usb/gspca/sq905.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static int
172172
sq905_read_data(struct gspca_dev *gspca_dev, u8 *data, int size, int need_lock)
173173
{
174174
int ret;
175-
int act_len;
175+
int act_len = 0;
176176

177177
gspca_dev->usb_buf[0] = '\0';
178178
if (need_lock)

0 commit comments

Comments
 (0)