drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update...
authorjsg <jsg@openbsd.org>
Fri, 11 Oct 2024 02:15:02 +0000 (02:15 +0000)
committerjsg <jsg@openbsd.org>
Fri, 11 Oct 2024 02:15:02 +0000 (02:15 +0000)
From Srinivasan Shanmugam
75839e2365b666ff4e1b9047e442cab138eac4f6 in linux-6.6.y/6.6.55
cd9e9e0852d501f169aa3bb34e4b413d2eb48c37 in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

index fa9f53b..d1329f2 100644 (file)
@@ -1281,7 +1281,8 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
            adev->dm.dc->caps.color.dpp.gamma_corr)
                attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
 
-       attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
+       if (afb)
+               attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
 
        if (crtc_state->stream) {
                mutex_lock(&adev->dm.dc_lock);