summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-06-22 05:05:57 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-06-22 05:05:57 +0000
commit81c07cd66ac4dddb5bc26a0d14dc32134cb12434 (patch)
tree08da5455a88b586e94b583a7a5a61ba6f477a181 /sys
parent56eca373768c3da96db16791cde14d4cbb01ff1f (diff)
drm:amd:amdgpu: Fix missing buffer object unlock in failure path
From Sukrut Bellary 8ca9880735b0a33a4ff54328d6c5eb60fe2b0a6d in linux-6.1.y/6.1.35 60ecaaf54886b0642d5c4744f7fbf1ff0d6b3e42 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c4
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/gfx_v9_0.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c b/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c
index 634a71a8c7a..152952f3f07 100644
--- a/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c
+++ b/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c
@@ -6969,8 +6969,10 @@ static int gfx_v10_0_kiq_resume(struct amdgpu_device *adev)
return r;
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
- if (unlikely(r != 0))
+ if (unlikely(r != 0)) {
+ amdgpu_bo_unreserve(ring->mqd_obj);
return r;
+ }
gfx_v10_0_kiq_init_queue(ring);
amdgpu_bo_kunmap(ring->mqd_obj);
diff --git a/sys/dev/pci/drm/amd/amdgpu/gfx_v9_0.c b/sys/dev/pci/drm/amd/amdgpu/gfx_v9_0.c
index bef65c75d2c..9ec57947684 100644
--- a/sys/dev/pci/drm/amd/amdgpu/gfx_v9_0.c
+++ b/sys/dev/pci/drm/amd/amdgpu/gfx_v9_0.c
@@ -3651,8 +3651,10 @@ static int gfx_v9_0_kiq_resume(struct amdgpu_device *adev)
return r;
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
- if (unlikely(r != 0))
+ if (unlikely(r != 0)) {
+ amdgpu_bo_unreserve(ring->mqd_obj);
return r;
+ }
gfx_v9_0_kiq_init_queue(ring);
amdgpu_bo_kunmap(ring->mqd_obj);