Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: cec: core: not all messages were passed on when monitoring

The valid_la boolean is used to check if the destination logical
address is either 15 (broadcast) or our logical address. If it is
for another logical address, then only adapters that have the
CEC_CAP_MONITOR_ALL capability can pass it on.

However, it is also used to do more detailed validity checks,
such as whether the message was broadcast when it should have been
directed, or vice versa, in which case the message must be ignored
according to the spec. But that should not apply to monitoring.

Add a new bool that just checks the LA and nothing else.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
6bade236 f100ce3b

+5 -2
+5 -2
drivers/media/cec/core/cec-adap.c
··· 1052 1052 u8 cmd = msg->msg[1]; 1053 1053 bool is_reply = false; 1054 1054 bool valid_la = true; 1055 + bool monitor_valid_la = true; 1055 1056 u8 min_len = 0; 1056 1057 1057 1058 if (WARN_ON(!msg->len || msg->len > CEC_MAX_MSG_SIZE)) ··· 1094 1093 adap->last_initiator = 0xff; 1095 1094 1096 1095 /* Check if this message was for us (directed or broadcast). */ 1097 - if (!cec_msg_is_broadcast(msg)) 1096 + if (!cec_msg_is_broadcast(msg)) { 1098 1097 valid_la = cec_has_log_addr(adap, msg_dest); 1098 + monitor_valid_la = valid_la; 1099 + } 1099 1100 1100 1101 /* 1101 1102 * Check if the length is not too short or if the message is a ··· 1230 1227 mutex_unlock(&adap->lock); 1231 1228 1232 1229 /* Pass the message on to any monitoring filehandles */ 1233 - cec_queue_msg_monitor(adap, msg, valid_la); 1230 + cec_queue_msg_monitor(adap, msg, monitor_valid_la); 1234 1231 1235 1232 /* We're done if it is not for us or a poll message */ 1236 1233 if (!valid_la || msg->len <= 1)