linux/drivers/gpu/drm/amd/display
Srinivasan Shanmugam 68f75e6f08 drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe
[ Upstream commit 8e4ed3cf16 ]

This commit addresses a null pointer dereference issue in the
`dcn20_program_pipe` function. The issue could occur when
`pipe_ctx->plane_state` is null.

The fix adds a check to ensure `pipe_ctx->plane_state` is not null
before accessing. This prevents a null pointer dereference.

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn20/dcn20_hwseq.c:1925 dcn20_program_pipe() error: we previously assumed 'pipe_ctx->plane_state' could be null (see line 1877)

Cc: Tom Chung <chiahsuan.chung@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Roman Li <roman.li@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[Xiangyu: BP to fix CVE: CVE-2024-49914, modified the file path from
drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn20/dcn20_hwseq.c to
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_hwseq.c
and minor conflict resolution]
Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-09 10:31:42 +01:00
..
amdgpu_dm drm/amd/display: Don't refer to dc_sink in is_dsc_need_re_compute 2024-12-09 10:31:41 +01:00
dc drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe 2024-12-09 10:31:42 +01:00
dmub drm/amd/display: Pass pwrseq inst for backlight and ABM 2024-01-20 11:51:48 +01:00
include drm/amd/display: Revert Avoid overflow assignment 2024-10-10 11:58:09 +02:00
modules drm/amd/display: Disable PSR-SU on Parade 08-01 TCON too 2024-11-01 01:58:33 +01:00
Kconfig drm/amd/display: Allow building DC with clang on RISC-V 2023-07-21 16:52:25 -04:00
Makefile drm/amd/display: Drop CONFIG_DRM_AMD_DC_HDCP 2023-03-07 14:22:39 -05:00
TODO drm/amd/display: Convert remaining loggers off dc_logger 2018-07-13 14:48:42 -05:00