Commit 02367f52 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: fix a dereference of a NULL pointer

[why&how]
In some platform out_transfer_func may not be popualted. We need to check
for null before dereferencing it.

Fixes: d2dea1f1 ("drm/amd/display: Generalize new minimal transition path")
Reviewed-by: default avatarAlvin Lee <alvin.lee2@amd.com>
Acked-by: default avatarTom Chung <chiahsuan.chung@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e4067957
...@@ -3057,7 +3057,8 @@ static void backup_planes_and_stream_state( ...@@ -3057,7 +3057,8 @@ static void backup_planes_and_stream_state(
scratch->blend_tf[i] = *status->plane_states[i]->blend_tf; scratch->blend_tf[i] = *status->plane_states[i]->blend_tf;
} }
scratch->stream_state = *stream; scratch->stream_state = *stream;
scratch->out_transfer_func = *stream->out_transfer_func; if (stream->out_transfer_func)
scratch->out_transfer_func = *stream->out_transfer_func;
} }
static void restore_planes_and_stream_state( static void restore_planes_and_stream_state(
...@@ -3079,7 +3080,8 @@ static void restore_planes_and_stream_state( ...@@ -3079,7 +3080,8 @@ static void restore_planes_and_stream_state(
*status->plane_states[i]->blend_tf = scratch->blend_tf[i]; *status->plane_states[i]->blend_tf = scratch->blend_tf[i];
} }
*stream = scratch->stream_state; *stream = scratch->stream_state;
*stream->out_transfer_func = scratch->out_transfer_func; if (stream->out_transfer_func)
*stream->out_transfer_func = scratch->out_transfer_func;
} }
/** /**
......
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