From 14855141dc3ef9c6479c2c64c838913fd7e2d108 Mon Sep 17 00:00:00 2001 From: Christopher Braga Date: Mon, 29 Apr 2019 17:15:37 -0400 Subject: [PATCH] drm/msm/hdcp: Check QSEECOM response only if message length is not 0 The received message logic in the SDE HDCP layer reads the HDCP QSEECOM response content regardless of the declared response length. Update this logic to only use the response content if the response length is non zero. Change-Id: Ie39923302a5478e0dd39dd5ceaade70b2e4125a3 Signed-off-by: Christopher Braga --- drivers/gpu/drm/msm/sde_hdcp_2x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/sde_hdcp_2x.c b/drivers/gpu/drm/msm/sde_hdcp_2x.c index 8b09324fdd810..d90facdc6312d 100644 --- a/drivers/gpu/drm/msm/sde_hdcp_2x.c +++ b/drivers/gpu/drm/msm/sde_hdcp_2x.c @@ -722,7 +722,10 @@ static void sde_hdcp_2x_msg_recvd(struct sde_hdcp_2x_ctrl *hdcp) goto exit; } - out_msg = (u32)hdcp->app_data.response.data[0]; + if (hdcp->app_data.response.length == 0) + out_msg = INVALID_MESSAGE; + else + out_msg = (u32)hdcp->app_data.response.data[0]; pr_debug("message received from TZ: %s\n", sde_hdcp_2x_message_name(out_msg));