[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c28a7070-b830-4fb1-9071-cce065a30147@amd.com>
Date: Thu, 14 Nov 2024 16:20:51 +0800
From: "Chung, ChiaHsuan (Tom)" <chiahsuan.chung@....com>
To: Zicheng Qu <quzicheng@...wei.com>, harry.wentland@....com,
sunpeng.li@....com, Rodrigo.Siqueira@....com, alexander.deucher@....com,
christian.koenig@....com, Xinhui.Pan@....com, airlied@...il.com,
simona@...ll.ch, Dillon.Varone@....com, Alvin.Lee2@....com,
nicholas.kazlauskas@....com, alex.hung@....com, aurabindo.pillai@....com,
relja.vojvodic@....com, wenjing.liu@....com, george.shen@....com,
mwen@...lia.com, yi-lchen@....com, martin.leung@....com,
srinivasan.shanmugam@....com, stylon.wang@....com, jun.lei@....com,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: tanghui20@...wei.com, zhangqiao22@...wei.com, judy.chenhui@...wei.com
Subject: Re: [PATCH 1/2] drm/amd/display: Fix null check for
pipe_ctx->plane_state in dcn20_program_pipe
Reviewed-by: Tom Chung <chiahsuan.chung@....com>
On 11/5/2024 10:01 PM, Zicheng Qu wrote:
> This commit addresses a null pointer dereference issue in
> dcn20_program_pipe(). Previously, commit 8e4ed3cf1642 ("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: 8e4ed3cf1642 ("drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe")
> Signed-off-by: Zicheng Qu <quzicheng@...wei.com>
> ---
> drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
> index a80c08582932..36d12db8d022 100644
> --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
> @@ -1923,9 +1923,9 @@ static void dcn20_program_pipe(
> dc->res_pool->hubbub, pipe_ctx->plane_res.hubp->inst, pipe_ctx->hubp_regs.det_size);
> }
>
> - if (pipe_ctx->update_flags.raw ||
> - (pipe_ctx->plane_state && pipe_ctx->plane_state->update_flags.raw) ||
> - pipe_ctx->stream->update_flags.raw)
> + if (pipe_ctx->plane_state && (pipe_ctx->update_flags.raw ||
> + pipe_ctx->plane_state->update_flags.raw ||
> + pipe_ctx->stream->update_flags.raw))
> dcn20_update_dchubp_dpp(dc, pipe_ctx, context);
>
> if (pipe_ctx->plane_state && (pipe_ctx->update_flags.bits.enable ||
Powered by blists - more mailing lists