[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241105140137.2465572-3-quzicheng@huawei.com>
Date: Tue, 5 Nov 2024 14:01:37 +0000
From: Zicheng Qu <quzicheng@...wei.com>
To: <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>,
<chiahsuan.chung@....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>, <quzicheng@...wei.com>
Subject: [PATCH 2/2] drm/amd/display: Fix null check for pipe_ctx->plane_state in hwss_setup_dpp
This commit addresses a null pointer dereference issue in
hwss_setup_dpp(). 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.
Fixes: 0baae6246307 ("drm/amd/display: Refactor fast update to use new HWSS build sequence")
Signed-off-by: Zicheng Qu <quzicheng@...wei.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
index 7ee2be8f82c4..bb766c2a7417 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
@@ -881,6 +881,9 @@ void hwss_setup_dpp(union block_sequence_params *params)
struct dpp *dpp = pipe_ctx->plane_res.dpp;
struct dc_plane_state *plane_state = pipe_ctx->plane_state;
+ if (!plane_state)
+ return;
+
if (dpp && dpp->funcs->dpp_setup) {
// program the input csc
dpp->funcs->dpp_setup(dpp,
--
2.34.1
Powered by blists - more mailing lists