Skip to contentSkip to conversation

media: usb: fix uninit-value in sq905_read_data

PATCH New Pavel Skripkin 1 participant 1 message Mar 11, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: usb: fix uninit-value in sq905_read_data

sybot reported uninit value in sq905_read_data(). The problem was in the error conditions in usb_bulk_msg() before act_len initialization.

---
 drivers/media/usb/gspca/sq905.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/gspca/sq905.c +1 -1
index 97799cfb832e..949111070971 100644
@@ -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)
Signature · 1 line
2.25.1