summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorDaniil Dulov <d.dulov@aladdin.ru>2023-03-14 18:04:49 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-05-25 16:21:19 +0200
commitfdaca63186f59fc664b346c45b76576624b48e57 (patch)
treedc703306504c92d1cdebcb220c76447d3de88cca /drivers/media/usb
parentmedia: platform: mtk-mdp3: release node reference before returning (diff)
downloadlinux-fdaca63186f59fc664b346c45b76576624b48e57.tar.xz
linux-fdaca63186f59fc664b346c45b76576624b48e57.zip
media: usb: Check az6007_read() return value
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 <d.dulov@aladdin.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb-v2/az6007.c3
1 files changed, 2 insertions, 1 deletions
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;