提交 8eccf35a 编写于 作者: A Andreas Pape 提交者: Greg Kroah-Hartman

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: NAndreas Pape <ap@ca-pape.de>
Reviewed-by: NKieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 50e9fda8
......@@ -164,7 +164,11 @@ int stk_camera_read_reg(struct stk_camera *dev, u16 index, u8 *value)
*value = *buf;
kfree(buf);
return ret;
if (ret < 0)
return ret;
else
return 0;
}
static int stk_start_stream(struct stk_camera *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册