Skip to content

Commit 4f71291

Browse files
Bhawanpreet Lakhaalexdeucher
authored andcommitted
drm/amd/display: Fix potential nullptr error
[Why] Fix surface/plane potential nullptr [How] add null check Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 3384521 commit 4f71291

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5313,6 +5313,12 @@ enum surface_update_type dm_determine_update_type_for_commit(struct dc *dc, stru
53135313
struct dc_stream_update stream_update;
53145314
enum surface_update_type update_type = UPDATE_TYPE_FAST;
53155315

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

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

0 commit comments

Comments
 (0)