From: Sohaib Nadeem <sohaib.nadeem@xxxxxxx> [why&how] Add the missing null check before dereference for dc_stream_status* Fixes: 06653fc22752 ("drm/amd/display: Implement update_planes_and_stream_v3 sequence") Reviewed-by: Josip Pavic <josip.pavic@xxxxxxx> Acked-by: Tom Chung <chiahsuan.chung@xxxxxxx> Signed-off-by: Sohaib Nadeem <sohaib.nadeem@xxxxxxx> --- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index cc4fd4e0deb6..dd9fe36646a3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -4291,6 +4291,9 @@ static int initialize_empty_surface_updates( struct dc_stream_status *status = dc_stream_get_status(stream); int i; + if (!status) + return 0; + for (i = 0; i < status->plane_count; i++) srf_updates[i].surface = status->plane_states[i]; -- 2.34.1