linux-loongson/drivers/gpu/drm/amd/display/modules/hdcp
Chenyuan Yang 7a2ca2ea64 drm/amd/display: Add null pointer check in mod_hdcp_hdcp1_create_session()
The function mod_hdcp_hdcp1_create_session() 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.

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

This is similar to the commit c3e9826a22
("drm/amd/display: Add null pointer check for get_first_active_display()").

Fixes: 2deade5ede ("drm/amd/display: Remove hdcp display state with mst fix")
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5e43eb3cd731649c4f8b9134f857be62a416c893)
2025-08-18 17:57:12 -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 in mod_hdcp_hdcp1_create_session() 2025-08-18 17:57:12 -04:00
hdcp_psp.h drm/amd/display: Fix hdcp_psp.h codestyle 2024-01-05 16:10:44 -05:00
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
Makefile drm/amd/display: Add execution and transition states for HDCP2.2 2019-11-19 10:12:53 -05:00