summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniil Dulov <d.dulov@aladdin.ru>2024-02-11 07:07:05 -0800
committerSasha Levin <sashal@kernel.org>2024-03-26 18:19:49 -0400
commit79159e7c485e16c2cccb740c3a8c01026e1710fa (patch)
tree071548133a59b9edf09152aee3422192c6656f5c /drivers
parentd164ddc21e986dd9ad614b4b01746e5457aeb24f (diff)
downloadlinux-stable-79159e7c485e16c2cccb740c3a8c01026e1710fa.tar.gz
linux-stable-79159e7c485e16c2cccb740c3a8c01026e1710fa.tar.bz2
linux-stable-79159e7c485e16c2cccb740c3a8c01026e1710fa.zip
media: go7007: add check of return value of go7007_read_addr()
[ Upstream commit 0b70530ee740861f4776ff724fcc25023df1799a ] If go7007_read_addr() returns error channel is not assigned a value. In this case go to allocfail. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 866b8695d67e ("Staging: add the go7007 video driver") 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/usb/go7007/go7007-usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c
index eeb85981e02b..762c13e49bfa 100644
--- a/drivers/media/usb/go7007/go7007-usb.c
+++ b/drivers/media/usb/go7007/go7007-usb.c
@@ -1201,7 +1201,9 @@ static int go7007_usb_probe(struct usb_interface *intf,
u16 channel;
/* read channel number from GPIO[1:0] */
- go7007_read_addr(go, 0x3c81, &channel);
+ if (go7007_read_addr(go, 0x3c81, &channel))
+ goto allocfail;
+
channel &= 0x3;
go->board_id = GO7007_BOARDID_ADLINK_MPG24;
usb->board = board = &board_adlink_mpg24;