mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
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: d2dea1f140
("drm/amd/display: Generalize new minimal transition path")
Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
25358e04a4
commit
fe869c2e53
@ -3024,7 +3024,8 @@ static void backup_planes_and_stream_state(
|
||||
scratch->blend_tf[i] = *status->plane_states[i]->blend_tf;
|
||||
}
|
||||
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(
|
||||
@ -3046,7 +3047,8 @@ static void restore_planes_and_stream_state(
|
||||
*status->plane_states[i]->blend_tf = scratch->blend_tf[i];
|
||||
}
|
||||
*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;
|
||||
}
|
||||
|
||||
static bool update_planes_and_stream_state(struct dc *dc,
|
||||
|
Loading…
Reference in New Issue
Block a user