summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-01-27 22:46:55 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-01-27 22:46:55 +0000
commit557066017d7d7c67696e8e62e0614eddb255c3f7 (patch)
tree1cc32a6f122cb505b1e595d7f5bde4ac91cf021f /sys/dev/pci
parent95d2b9906c55ce6259872f45686acc5d055e3470 (diff)
drm/amd/display: Fix bug in debugfs crc_win_update entry
From Wayne Lin 6dcc6706dab10744d277bdc2613fb135c6a632dd in linux 5.15.y/5.15.17 4bef85d4c9491415b7931407b07f24841c1e0390 in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index de9ec5ddb6c..e94ddd5e7b6 100644
--- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -2908,10 +2908,13 @@ static int crc_win_update_set(void *data, u64 val)
struct amdgpu_device *adev = drm_to_adev(new_crtc->dev);
struct crc_rd_work *crc_rd_wrk = adev->dm.crc_rd_wrk;
+ if (!crc_rd_wrk)
+ return 0;
+
if (val) {
spin_lock_irq(&adev_to_drm(adev)->event_lock);
spin_lock_irq(&crc_rd_wrk->crc_rd_work_lock);
- if (crc_rd_wrk && crc_rd_wrk->crtc) {
+ if (crc_rd_wrk->crtc) {
old_crtc = crc_rd_wrk->crtc;
old_acrtc = to_amdgpu_crtc(old_crtc);
}