From cce1406cde5f91096f533c0e77dab0a24f1b72f3 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 11 Oct 2024 02:15:02 +0000 Subject: [PATCH] drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update (v2) 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index fa9f53b3107..d1329f20b7b 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -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); -- 2.20.1