Skip to content

Commit 374c9fa

Browse files
Ma Kealexdeucher
authored andcommitted
drm/amd/display: Fix null check for pipe_ctx->plane_state in resource_build_scaling_params
Null pointer dereference 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. Found by code review. Fixes: 3be5262 ("drm/amd/display: Rename more dc_surface stuff to plane_state") Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Ma Ke <make24@iscas.ac.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 63e6a77) Cc: stable@vger.kernel.org
1 parent 7eb1721 commit 374c9fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,8 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
14551455
DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
14561456

14571457
/* Invalid input */
1458-
if (!plane_state->dst_rect.width ||
1458+
if (!plane_state ||
1459+
!plane_state->dst_rect.width ||
14591460
!plane_state->dst_rect.height ||
14601461
!plane_state->src_rect.width ||
14611462
!plane_state->src_rect.height) {

0 commit comments

Comments
 (0)