linux/drivers/gpu/drm/amd/display/modules
Wentao Liang 4ce9f2dc9f drm/amd/display: Add null pointer check for get_first_active_display()
commit c3e9826a22 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-07-06 11:01:45 +02:00
..
color drm/amd/display: Fix compiler warnings on high compiler warning levels 2024-04-09 22:05:04 -04:00
freesync drm/amd/display: Limit VTotal range to max hw cap minus fp 2024-12-14 20:03:28 +01:00
hdcp drm/amd/display: Add null pointer check for get_first_active_display() 2025-07-06 11:01:45 +02:00
inc drm/amd/display: revert Exit idle optimizations before HDCP execution 2024-03-20 13:36:29 -04:00
info_packet drm/amd/display: Fix BT2020 YCbCr limited/full range input 2025-05-29 11:02:44 +02:00
power drm/amd/display: Disable PSR-SU on Parade 08-01 TCON too 2024-10-22 18:13:03 -04:00
vmid drm/amd: Fix spelling typo in comments 2022-06-03 16:43:36 -04:00