]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amd/display: Check for NULL pointer
authorSung Joon Kim <sungjoon.kim@amd.com>
Mon, 8 Jul 2024 23:29:49 +0000 (19:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Jul 2024 21:30:23 +0000 (17:30 -0400)
[why & how]
Need to make sure plane_state is initialized
before accessing its members.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Xi (Alex) Liu <xi.liu@amd.com>
Signed-off-by: Sung Joon Kim <sungjoon.kim@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 295d91cbc700651782a60572f83c24861607b648)

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

index 067f6555cfdff6a5effbda552d1bd56d9670f2ab..ccbb15f1638c8b73e45602333d8e3d42b6548f26 100644 (file)
@@ -143,7 +143,8 @@ const struct dc_plane_status *dc_plane_get_status(
                if (pipe_ctx->plane_state != plane_state)
                        continue;
 
-               pipe_ctx->plane_state->status.is_flip_pending = false;
+               if (pipe_ctx->plane_state)
+                       pipe_ctx->plane_state->status.is_flip_pending = false;
 
                break;
        }