linux_dsm_epyc7002/drivers/media/i2c/smiapp
Colin Ian King 7a2148dfda media: smiapp: fix timeout checking in smiapp_read_nvm
The current code decrements the timeout counter i and the end of
each loop i is incremented, so the check for timeout will always
be false and hence the timeout mechanism is just a dead code path.
Potentially, if the RD_READY bit is not set, we could end up in
an infinite loop.

Fix this so the timeout starts from 1000 and decrements to zero,
if at the end of the loop i is zero we have a timeout condition.

Detected by CoverityScan, CID#1324008 ("Logically dead code")

Fixes: ccfc97bdb5 ("[media] smiapp: Add driver")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-17 06:22:08 -04:00
..
Kconfig [media] v4l: Switch from V4L2 OF not V4L2 fwnode API 2017-06-06 09:58:16 -03:00
Makefile
smiapp-core.c media: smiapp: fix timeout checking in smiapp_read_nvm 2018-05-17 06:22:08 -04:00
smiapp-limits.c [media] smiapp: Remove FSF's address from the license header 2014-12-23 11:27:47 -02:00
smiapp-limits.h [media] smiapp: Remove FSF's address from the license header 2014-12-23 11:27:47 -02:00
smiapp-quirk.c media: smiapp: make various const arrays static 2017-07-19 15:53:14 -04:00
smiapp-quirk.h [media] smiapp: Add parentheses to macro arguments used in macros 2014-12-23 11:51:30 -02:00
smiapp-reg-defs.h [media] smiapp: Remove FSF's address from the license header 2014-12-23 11:27:47 -02:00
smiapp-reg.h [media] smiapp: Remove FSF's address from the license header 2014-12-23 11:27:47 -02:00
smiapp-regs.c media: smiapp: Rely on runtime PM 2017-10-24 17:14:25 +02:00
smiapp-regs.h [media] smiapp: Remove FSF's address from the license header 2014-12-23 11:27:47 -02:00
smiapp.h media: smiapp: Rely on runtime PM 2017-10-24 17:14:25 +02:00