linux/drivers/gpu/drm/amd/display/modules/hdcp
Wentao Liang c3e9826a22 drm/amd/display: Add null pointer check for get_first_active_display()
The function mod_hdcp_hdcp1_enable_encryption() calls the function
get_first_active_display(), but does not check its return value.
The return value is a null pointer if the display list is empty.
This will lead to a null pointer dereference in
mod_hdcp_hdcp2_enable_encryption().

Add a null pointer check for get_first_active_display() and return
MOD_HDCP_STATUS_DISPLAY_NOT_FOUND if the function return null.

Fixes: 2deade5ede ("drm/amd/display: Remove hdcp display state with mst fix")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # v5.8
2025-05-29 10:57:13 -04:00
..
Makefile
hdcp.c drm/amd/display: revert Exit idle optimizations before HDCP execution 2024-03-20 13:36:29 -04:00
hdcp.h drm/amd/display: HDCP Locality check using DMUB Fused IO 2025-04-07 18:01:07 -04:00
hdcp1_execution.c drm/amd/display: Revert "Check HDCP returned status" 2024-07-23 17:07:10 -04:00
hdcp1_transition.c drm/amd/display: add authentication_complete in hdcp output 2021-08-09 15:43:33 -04:00
hdcp2_execution.c drm/amd/display: HDCP Locality check using DMUB Fused IO 2025-04-07 18:01:07 -04:00
hdcp2_transition.c drm/amd/display: HDCP Locality check using DMUB Fused IO 2025-04-07 18:01:07 -04:00
hdcp_ddc.c drm/amd/display: HDCP Locality check using DMUB Fused IO 2025-04-07 18:01:07 -04:00
hdcp_log.c drm/amd/display: add authentication_complete in hdcp output 2021-08-09 15:43:33 -04:00
hdcp_log.h drm/amd/display: Fix hdcp_log.h codestyle 2024-01-05 16:10:44 -05:00
hdcp_psp.c drm/amd/display: Add null pointer check for get_first_active_display() 2025-05-29 10:57:13 -04:00
hdcp_psp.h drm/amd/display: Fix hdcp_psp.h codestyle 2024-01-05 16:10:44 -05:00