alistair23-linux/drivers/media/cec
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-adap.c [media] cec: drop MEDIA_CEC_DEBUG 2017-06-04 15:23:36 -03:00
cec-api.c [media] cec: race fix: don't return -ENONET in cec_receive() 2017-06-08 07:36:36 -03:00
cec-core.c [media] cec: drop MEDIA_CEC_DEBUG 2017-06-04 15:23:36 -03:00
cec-edid.c [media] cec.h: merge cec-edid.h into cec.h 2017-04-19 06:53:18 -03:00
cec-notifier.c [media] cec.h: merge cec-edid.h into cec.h 2017-04-19 06:53:18 -03:00
cec-priv.h
Kconfig [media] cec: improve MEDIA_CEC_RC dependencies 2017-06-06 07:11:02 -03:00
Makefile [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER 2017-06-04 15:23:35 -03:00