Skip to content

Commit fe869c2

Browse files
Wenjing Liualexdeucher
authored andcommitted
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: d2dea1f ("drm/amd/display: Generalize new minimal transition path") Reviewed-by: Alvin Lee <[email protected]> Acked-by: Tom Chung <[email protected]> Signed-off-by: Wenjing Liu <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 25358e0 commit fe869c2

File tree

1 file changed

+4
-2
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,7 +3024,8 @@ static void backup_planes_and_stream_state(
30243024
scratch->blend_tf[i] = *status->plane_states[i]->blend_tf;
30253025
}
30263026
scratch->stream_state = *stream;
3027-
scratch->out_transfer_func = *stream->out_transfer_func;
3027+
if (stream->out_transfer_func)
3028+
scratch->out_transfer_func = *stream->out_transfer_func;
30283029
}
30293030

30303031
static void restore_planes_and_stream_state(
@@ -3046,7 +3047,8 @@ static void restore_planes_and_stream_state(
30463047
*status->plane_states[i]->blend_tf = scratch->blend_tf[i];
30473048
}
30483049
*stream = scratch->stream_state;
3049-
*stream->out_transfer_func = scratch->out_transfer_func;
3050+
if (stream->out_transfer_func)
3051+
*stream->out_transfer_func = scratch->out_transfer_func;
30503052
}
30513053

30523054
static bool update_planes_and_stream_state(struct dc *dc,

0 commit comments

Comments
 (0)