Searched hist:cc17afa2 (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/media/i2c/ |
H A D | ov02a10.c | cc17afa2 Fri Dec 04 02:20:14 CST 2020 Arnd Bergmann <arnd@arndb.de> media: i2c: fix an uninitialized error code
Clang points out that the error handling in ov02a10_s_stream() is broken, and just returns a random error code:
drivers/media/i2c/ov02a10.c:537:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (ov02a10->streaming == on) ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/i2c/ov02a10.c:568:9: note: uninitialized use occurs here return ret; ^~~ drivers/media/i2c/ov02a10.c:537:2: note: remove the 'if' if its condition is always false if (ov02a10->streaming == on) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If streaming is already on, leave it that way and return success.
Suggested-by: Dongchun Zhu <dongchun.zhu@mediatek.com> Fixes: 91807efbe8ec ("media: i2c: add OV02A10 image sensor driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
|