linux/drivers/media
Hans Verkuil b94aac64a4 [media] cec: race fix: don't return -ENONET in cec_receive()
When calling CEC_RECEIVE do not check if the adapter is configured.
Typically CEC_RECEIVE is called after a select() and if that indicates
that there are messages in the receive queue, then you should always be
able to dequeue a message.

The race condition here is that a message has been received and is
queued, so select() tells userspace that a message is available. But
before the application calls CEC_RECEIVE the adapter is unconfigured
(e.g. the HDMI cable is removed). Now select will always report that
there is a message, but calling CEC_RECEIVE will always return -ENONET
because the adapter is no longer configured and so will never actually
dequeue the message.

There is really no need for this check, and in fact the ENONET error
code was never documented for CEC_RECEIVE. This may have been a left-over
of old code that was never updated.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org>      # for v4.10 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-08 07:36:36 -03:00
..
cec [media] cec: race fix: don't return -ENONET in cec_receive() 2017-06-08 07:36:36 -03:00
common [media] b2c2: constify nxt200x_config structure 2017-04-17 12:18:18 -03:00
dvb-core [media] media/dvb-core: Race condition when writing to CAM 2017-04-17 17:20:23 -03:00
dvb-frontends treewide: spelling: correct diffrent[iate] and banlance typos 2017-05-08 17:15:13 -07:00
firewire
i2c [media] tc358743: fix register i2c_rd/wr function fix 2017-06-06 07:09:23 -03:00
mmc
pci Annotation of module parameters that specify device settings 2017-05-10 19:13:03 -07:00
platform [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER 2017-06-04 15:23:35 -03:00
radio [media] wl128x: use setup_timer 2017-04-10 14:56:37 -03:00
rc [media] sir_ir: infinite loop in interrupt handler 2017-06-06 07:19:10 -03:00
spi
tuners [media] xc5000: fix spelling mistake: "calibration" 2017-04-19 08:29:21 -03:00
usb [media] rainshadow-cec: Fix missing spin_lock_init() 2017-06-06 07:10:01 -03:00
v4l2-core [media] vb2: Fix an off by one error in 'vb2_plane_vaddr' 2017-06-06 07:10:39 -03:00
Kconfig [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER 2017-06-04 15:23:35 -03:00
Makefile [media] cec: select CEC_CORE instead of depend on it 2017-06-04 15:23:33 -03:00
media-device.c
media-devnode.c
media-entity.c [media] media-entity: only call dev_dbg_obj if mdev is not NULL 2017-04-19 08:15:51 -03:00