From: Daniil Dulov Date: Tue, 14 Mar 2023 17:04:49 +0000 (-0700) Subject: media: usb: Check az6007_read() return value X-Git-Tag: Ubuntu-6.2.0-36.36~906 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9eaf4c295d31fabe28212070b3eff2b0ed4eeb6e;p=mirror_ubuntu-kernels.git media: usb: Check az6007_read() return value BugLink: https://bugs.launchpad.net/bugs/2034469 [ Upstream commit fdaca63186f59fc664b346c45b76576624b48e57 ] If az6007_read() returns error, there is no sence to continue. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 3af2f4f15a61 ("[media] az6007: Change the az6007 read/write routine parameter") Signed-off-by: Daniil Dulov Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin Signed-off-by: Kamal Mostafa Signed-off-by: Stefan Bader --- diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c index 62ee09f28a0b..7524c90f5da6 100644 --- a/drivers/media/usb/dvb-usb-v2/az6007.c +++ b/drivers/media/usb/dvb-usb-v2/az6007.c @@ -202,7 +202,8 @@ static int az6007_rc_query(struct dvb_usb_device *d) unsigned code; enum rc_proto proto; - az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10); + if (az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10) < 0) + return -EIO; if (st->data[1] == 0x44) return 0;