Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bhawanpreet Lakha and committed by
Alex Deucher
4f712911 3384521a

+6
+6
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 5313 5313 struct dc_stream_update stream_update; 5314 5314 enum surface_update_type update_type = UPDATE_TYPE_FAST; 5315 5315 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 + } 5316 5322 5317 5323 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { 5318 5324 new_dm_crtc_state = to_dm_crtc_state(new_crtc_state);