drm/amd/display: Add null check before access structs

BugLink: https://bugs.launchpad.net/bugs/2083196

[ Upstream commit c96140000915b610d86f941450e15ca552de154a ]

In enable_phantom_plane, we should better check null pointer before
accessing various structs.

Fixes: 09a4ec5da9 ("drm/amd/display: Refactor dc_state interface")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
Ma Ke
2024-06-26 21:06:50 +08:00
committed by Mehmet Basaran
parent 88ebe8cc19
commit 8a064abb4d
@@ -750,6 +750,8 @@ static void enable_phantom_plane(struct dml2_context *ctx,
ctx->config.svp_pstate.callbacks.dc,
state,
curr_pipe->plane_state);
if (!phantom_plane)
return;
}
memcpy(&phantom_plane->address, &curr_pipe->plane_state->address, sizeof(phantom_plane->address));