summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-10-11 02:15:03 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-10-11 02:15:03 +0000
commit7300776fa28b463cf435cbf3a4026c70c069325d (patch)
tree6ed394dbf148893447c323fb1f0dfdd404ea08db
parent6393e417f74df8b14da6a0cdcdc7b93c041a48a3 (diff)
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
-rw-r--r--sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c3
1 files changed, 2 insertions, 1 deletions
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);