drm:amd:amdgpu: Fix missing buffer object unlock in failure path
authorjsg <jsg@openbsd.org>
Thu, 22 Jun 2023 05:05:56 +0000 (05:05 +0000)
committerjsg <jsg@openbsd.org>
Thu, 22 Jun 2023 05:05:56 +0000 (05:05 +0000)
From Sukrut Bellary
8ca9880735b0a33a4ff54328d6c5eb60fe2b0a6d in linux-6.1.y/6.1.35
60ecaaf54886b0642d5c4744f7fbf1ff0d6b3e42 in mainline linux

sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c
sys/dev/pci/drm/amd/amdgpu/gfx_v9_0.c

index 634a71a..152952f 100644 (file)
@@ -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);
index bef65c7..9ec5794 100644 (file)
@@ -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);