]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Fix null check for pipe_ctx->plane_state in hwss_setup_dpp
authorZicheng Qu <quzicheng@huawei.com>
Tue, 5 Nov 2024 14:01:37 +0000 (14:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:05 +0000 (13:54 +0100)
[ Upstream commit 2bc96c95070571c6c824e0d4c7783bee25a37876 ]

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")
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Zicheng Qu <quzicheng@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c

index 4a88412fdfab136bf62aa7b36a8df7fe0f058569..29ef24f9a40f2cb4b8e2922bfb3428df14b14669 100644 (file)
@@ -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,