Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f712911 authored by Bhawanpreet Lakha's avatar Bhawanpreet Lakha Committed by Alex Deucher
Browse files

drm/amd/display: Fix potential nullptr error



[Why]
Fix surface/plane potential nullptr

[How]
add null check

Signed-off-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3384521a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -5313,6 +5313,12 @@ enum surface_update_type dm_determine_update_type_for_commit(struct dc *dc, stru
	struct dc_stream_update stream_update;
	enum surface_update_type update_type = UPDATE_TYPE_FAST;

	if (!updates || !surface) {
		DRM_ERROR("Plane or surface update failed to allocate");
		/* Set type to FULL to avoid crashing in DC*/
		update_type = UPDATE_TYPE_FULL;
		goto ret;
	}

	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
		new_dm_crtc_state = to_dm_crtc_state(new_crtc_state);