media: stkwebcam: Bugfix for wrong return values
authorAndreas Pape <ap@ca-pape.de>
Fri, 23 Nov 2018 16:14:54 +0000 (11:14 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 09:41:26 +0000 (10:41 +0100)
commit47ebdd7ee39c11d4ab832e569389adc4b5c49439
tree0475dda364d5e3fb8341fb5d76fffe2ba8981ca8
parent95595c8f60ca995e6ab7e10130265762d504f553
media: stkwebcam: Bugfix for wrong return values

[ Upstream commit 3c28b91380dd1183347d32d87d820818031ebecf ]

usb_control_msg returns in case of a successfully sent message the number
of sent bytes as a positive number. Don't use this value as a return value
for stk_camera_read_reg, as a non-zero return value is used as an error
condition in some cases when stk_camera_read_reg is called.

Signed-off-by: Andreas Pape <ap@ca-pape.de>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/stkwebcam/stk-webcam.c