Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] soc-camera: Fix a return value in case of error

If 'ov9640_reg_read()' does not return 0, then 'val' is left unmodified.
As it is not initialized either, the return value can be anything.

It is likely that returning the error code was expected here.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Christophe JAILLET and committed by
Mauro Carvalho Chehab
a5bc63f2 f41003a2

+1 -1
+1 -1
drivers/media/i2c/soc_camera/ov9640.c
··· 233 233 if (ret) { 234 234 dev_err(&client->dev, 235 235 "[Read]-Modify-Write of register %02x failed!\n", reg); 236 - return val; 236 + return ret; 237 237 } 238 238 239 239 val |= set;