[PATCH] drm/amdgpu: release correct lock in amdgpu_gfx_enable_kgq()

Dan Carpenter dan.carpenter at linaro.org
Tue May 9 14:21:14 UTC 2023


This function was releasing the incorrect lock on the error path.

Reported-by: kernel test robot <lkp at intel.com>
Fixes: 9bfa241d1289 ("drm/amdgpu: add [en/dis]able_kgq() functions")
Signed-off-by: Dan Carpenter <dan.carpenter at linaro.org>
---
The LKP robot sent me an email about this after I had already written
the patch.  (I review LKP Smatch emails and hit forward).

 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 969f256aa003..7d2f119d9223 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -644,7 +644,7 @@ int amdgpu_gfx_enable_kgq(struct amdgpu_device *adev, int xcc_id)
 						adev->gfx.num_gfx_rings);
 		if (r) {
 			DRM_ERROR("Failed to lock KIQ (%d).\n", r);
-			spin_unlock(&adev->gfx.kiq[0].ring_lock);
+			spin_unlock(&kiq->ring_lock);
 			return r;
 		}
 
-- 
2.39.2



More information about the amd-gfx mailing list