Skip to content

Commit 6a05707

Browse files
Zicheng Qualexdeucher
authored andcommitted
drm/amd/display: Fix null check for pipe_ctx->plane_state in dcn20_program_pipe
This commit addresses a null pointer dereference issue in dcn20_program_pipe(). Previously, commit 8e4ed3c ("drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe") partially fixed the null pointer dereference issue. However, in dcn20_update_dchubp_dpp(), the variable pipe_ctx is passed in, and plane_state is accessed again through pipe_ctx. Multiple if statements directly call attributes of plane_state, leading to potential null pointer dereference issues. This patch adds necessary null checks to ensure stability. Fixes: 8e4ed3c ("drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe") Reviewed-by: Tom Chung <[email protected]> Signed-off-by: Zicheng Qu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 7037bb0 commit 6a05707

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,9 +1925,9 @@ static void dcn20_program_pipe(
19251925
dc->res_pool->hubbub, pipe_ctx->plane_res.hubp->inst, pipe_ctx->hubp_regs.det_size);
19261926
}
19271927

1928-
if (pipe_ctx->update_flags.raw ||
1929-
(pipe_ctx->plane_state && pipe_ctx->plane_state->update_flags.raw) ||
1930-
pipe_ctx->stream->update_flags.raw)
1928+
if (pipe_ctx->plane_state && (pipe_ctx->update_flags.raw ||
1929+
pipe_ctx->plane_state->update_flags.raw ||
1930+
pipe_ctx->stream->update_flags.raw))
19311931
dcn20_update_dchubp_dpp(dc, pipe_ctx, context);
19321932

19331933
if (pipe_ctx->plane_state && (pipe_ctx->update_flags.bits.enable ||

0 commit comments

Comments
 (0)