summaryrefslogtreecommitdiffstats
path: root/drivers/media/cec/cec-adap.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-11-04 07:52:11 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-16 15:42:03 -0200
commit7ae2a888eedd5a6b03849614eddd55f31793eeae (patch)
treee163fbf77134eede348a129f6216e99be1936c46 /drivers/media/cec/cec-adap.c
parent0dbacebede1e4e44bf500f94d692fad05eb2c293 (diff)
downloadop-kernel-dev-7ae2a888eedd5a6b03849614eddd55f31793eeae.zip
op-kernel-dev-7ae2a888eedd5a6b03849614eddd55f31793eeae.tar.gz
[media] cec: sanitize msg.flags
The CEC_MSG_FL_REPLY_TO_FOLLOWERS message flag only makes sense for transmitted messages where you want to wait for the reply. Clear the flag in all other cases. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/cec/cec-adap.c')
-rw-r--r--drivers/media/cec/cec-adap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c
index 054cd06..bcd19d4 100644
--- a/drivers/media/cec/cec-adap.c
+++ b/drivers/media/cec/cec-adap.c
@@ -595,6 +595,10 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
/* Make sure the timeout isn't 0. */
msg->timeout = 1000;
}
+ if (msg->timeout)
+ msg->flags &= CEC_MSG_FL_REPLY_TO_FOLLOWERS;
+ else
+ msg->flags = 0;
/* Sanity checks */
if (msg->len == 0 || msg->len > CEC_MAX_MSG_SIZE) {
OpenPOWER on IntegriCloud