]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: cec: core: remove length check of Timer Status
authorNini Song <nini.song@mediatek.com>
Thu, 25 Jan 2024 13:28:45 +0000 (21:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:23:33 +0000 (16:23 +0200)
commit ce5d241c3ad4568c12842168288993234345c0eb upstream.

The valid_la is used to check the length requirements,
including special cases of Timer Status. If the length is
shorter than 5, that means no Duration Available is returned,
the message will be forced to be invalid.

However, the description of Duration Available in the spec
is that this parameter may be returned when these cases, or
that it can be optionally return when these cases. The key
words in the spec description are flexible choices.

Remove the special length check of Timer Status to fit the
spec which is not compulsory about that.

Signed-off-by: Nini Song <nini.song@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/cec/core/cec-adap.c

index 97b479223fe52f4675ed675578cbc86068cc73fd..2f7ab5df1c5842f82abe4283d087c49f65801fe2 100644 (file)
@@ -1116,20 +1116,6 @@ void cec_received_msg_ts(struct cec_adapter *adap,
        if (valid_la && min_len) {
                /* These messages have special length requirements */
                switch (cmd) {
-               case CEC_MSG_TIMER_STATUS:
-                       if (msg->msg[2] & 0x10) {
-                               switch (msg->msg[2] & 0xf) {
-                               case CEC_OP_PROG_INFO_NOT_ENOUGH_SPACE:
-                               case CEC_OP_PROG_INFO_MIGHT_NOT_BE_ENOUGH_SPACE:
-                                       if (msg->len < 5)
-                                               valid_la = false;
-                                       break;
-                               }
-                       } else if ((msg->msg[2] & 0xf) == CEC_OP_PROG_ERROR_DUPLICATE) {
-                               if (msg->len < 5)
-                                       valid_la = false;
-                       }
-                       break;
                case CEC_MSG_RECORD_ON:
                        switch (msg->msg[2]) {
                        case CEC_OP_RECORD_SRC_OWN: