mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
media: gspca: Add error handling for stv06xx_read_sensor()
commit 398a1b33f1479af35ca915c5efc9b00d6204f8fa upstream.
In hdcs_init(), the return value of stv06xx_read_sensor() needs to be
checked. A proper implementation can be found in vv6410_dump(). Add a
check in loop condition and propergate error code to fix this issue.
Fixes: 4c98834add ("V4L/DVB (10048): gspca - stv06xx: New subdriver.")
Cc: stable@vger.kernel.org # v2.6+
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b51ce65c44
commit
658029a3c8
1 changed files with 4 additions and 3 deletions
|
|
@ -520,12 +520,13 @@ static int hdcs_init(struct sd *sd)
|
|||
static int hdcs_dump(struct sd *sd)
|
||||
{
|
||||
u16 reg, val;
|
||||
int err = 0;
|
||||
|
||||
pr_info("Dumping sensor registers:\n");
|
||||
|
||||
for (reg = HDCS_IDENT; reg <= HDCS_ROWEXPH; reg++) {
|
||||
stv06xx_read_sensor(sd, reg, &val);
|
||||
for (reg = HDCS_IDENT; reg <= HDCS_ROWEXPH && !err; reg++) {
|
||||
err = stv06xx_read_sensor(sd, reg, &val);
|
||||
pr_info("reg 0x%02x = 0x%02x\n", reg, val);
|
||||
}
|
||||
return 0;
|
||||
return (err < 0) ? err : 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue