Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 013fb505 authored by Daniil Dulov's avatar Daniil Dulov Committed by Sasha Levin
Browse files

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: 866b8695 ("Staging: add the go7007 video driver")
Signed-off-by: default avatarDaniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8c2e4efe
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1198,7 +1198,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;