Commit c9614000 authored by Ma Ke's avatar Ma Ke Committed by Alex Deucher

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

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

Fixes: 09a4ec5d ("drm/amd/display: Refactor dc_state interface")
Signed-off-by: default avatarMa Ke <make24@iscas.ac.cn>
Reviewed-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b17eecc0
...@@ -750,6 +750,8 @@ static void enable_phantom_plane(struct dml2_context *ctx, ...@@ -750,6 +750,8 @@ static void enable_phantom_plane(struct dml2_context *ctx,
ctx->config.svp_pstate.callbacks.dc, ctx->config.svp_pstate.callbacks.dc,
state, state,
curr_pipe->plane_state); curr_pipe->plane_state);
if (!phantom_plane)
return;
} }
memcpy(&phantom_plane->address, &curr_pipe->plane_state->address, sizeof(phantom_plane->address)); memcpy(&phantom_plane->address, &curr_pipe->plane_state->address, sizeof(phantom_plane->address));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment