[why]
we don't support authentication with DEVICE_COUNT=0
[how]
check value DEVICE_COUNT before doing authentication
Signed-off-by: Yu-ting Shen <Yu-ting.Shen@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Wayne Lin <waynelin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 
 static inline enum mod_hdcp_status check_device_count(struct mod_hdcp *hdcp)
 {
+       /* Avoid device count == 0 to do authentication */
+       if (0 == get_device_count(hdcp)) {
+               return MOD_HDCP_STATUS_HDCP1_DEVICE_COUNT_MISMATCH_FAILURE;
+       }
+
        /* Some MST display may choose to report the internal panel as an HDCP RX.
         * To update this condition with 1(because the immediate repeater's internal
         * panel is possibly not included in DEVICE_COUNT) + get_device_count(hdcp).
 
 
 static enum mod_hdcp_status check_device_count(struct mod_hdcp *hdcp)
 {
+       /* Avoid device count == 0 to do authentication */
+       if (0 == get_device_count(hdcp)) {
+               return MOD_HDCP_STATUS_HDCP1_DEVICE_COUNT_MISMATCH_FAILURE;
+       }
+
        /* Some MST display may choose to report the internal panel as an HDCP RX.   */
        /* To update this condition with 1(because the immediate repeater's internal */
        /* panel is possibly not included in DEVICE_COUNT) + get_device_count(hdcp). */