linux/drivers/media
Colin Ian King 25bf6e7836 media: smiapp: fix timeout checking in smiapp_read_nvm
commit 7a2148dfda upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-11-20 18:04:56 +00:00
..
common [media] siano: add support for PCTV 77e 2014-11-17 14:11:49 +00:00
dvb-core media: dvb_frontend: fix locking issues at dvb_frontend_get_event() 2018-11-20 18:04:47 +00:00
dvb-frontends drxd_hard: fix bad alignments 2018-11-20 18:04:45 +00:00
firewire firewire: introduce fw_driver.probe and .remove methods 2013-06-09 18:15:00 +02:00
i2c media: smiapp: fix timeout checking in smiapp_read_nvm 2018-11-20 18:04:56 +00:00
mmc [media] siano: get rid of CammelCase from smscoreapi.h 2013-03-21 10:03:16 -03:00
parport [media] media: parport: Fix format string mismatch in bw-qcam.c 2014-05-23 12:18:53 -03:00
pci media: cx25821: prevent out-of-bounds read on array card 2018-10-21 08:44:49 +01:00
platform media: omap3isp/isp: remove an unused static var 2018-11-20 18:04:47 +00:00
radio [media] si4713: fix Kconfig dependencies 2014-03-28 18:06:55 -03:00
rc media: rc: mce_kbd decoder: fix stuck keys 2018-11-20 18:04:48 +00:00
tuners xc2028: Fix use-after-free bug properly 2017-02-23 03:54:39 +00:00
usb media: cx231xx: Add support for AverMedia DVD EZMaker 7 2018-11-20 18:04:48 +00:00
v4l2-core media: v4l2-compat-ioctl32: prevent go past max size 2018-11-20 18:04:47 +00:00
Kconfig [media] subdev autoselect only works if I2C and I2C_MUX is selected 2013-12-21 06:03:06 -02:00
Makefile [media] move i2c files into drivers/media/i2c 2012-09-06 18:42:54 -03:00
media-device.c media: media-device: Remove duplicated memset() in media_enum_entities() 2014-09-17 09:21:49 -07:00
media-devnode.c [media] media: Use a better owner for the media device 2014-05-13 13:39:00 -03:00
media-entity.c [media] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNECT flag 2013-12-04 15:03:45 -02:00