summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/cros-ec-cec/cros-ec-cec.c')
-rw-r--r--drivers/media/platform/cros-ec-cec/cros-ec-cec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/cros-ec-cec/cros-ec-cec.c b/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
index 7bc4d8a9a..1f3577024 100644
--- a/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
+++ b/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
@@ -44,6 +44,8 @@ static void handle_cec_message(struct cros_ec_cec *cros_ec_cec)
uint8_t *cec_message = cros_ec->event_data.data.cec_message;
unsigned int len = cros_ec->event_size;
+ if (len > CEC_MAX_MSG_SIZE)
+ len = CEC_MAX_MSG_SIZE;
cros_ec_cec->rx_msg.len = len;
memcpy(cros_ec_cec->rx_msg.msg, cec_message, len);