media: usb: Check az6007_read() return value

[ Upstream commit fdaca63186 ]

If az6007_read() returns error, there is no sence to continue.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 3af2f4f15a ("[media] az6007: Change the az6007 read/write routine parameter")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Daniil Dulov 2023-03-14 10:04:49 -07:00 committed by Greg Kroah-Hartman
parent 0b3d2aa627
commit a8af55f7f4
1 changed files with 2 additions and 1 deletions

View File

@ -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;