]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: Add the missing error handling for xa_store() call
authorArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Wed, 30 Oct 2024 05:25:22 +0000 (10:55 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 8 Apr 2025 20:48:17 +0000 (16:48 -0400)
Add the missing error handling for xa_store() call in the function
amdgpu_userq_fence_driver_alloc().

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c

index b475643ab5eccbc4b6be41e43ee9d4d85e4717f5..969a3a75d8152739b398f2ac866e75c1cc9ec96b 100644 (file)
@@ -102,9 +102,11 @@ int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev,
        get_task_comm(fence_drv->timeline_name, current);
 
        xa_lock_irqsave(&adev->userq_xa, flags);
-       __xa_store(&adev->userq_xa, userq->doorbell_index,
-                  fence_drv, GFP_KERNEL);
+       r = xa_err(__xa_store(&adev->userq_xa, userq->doorbell_index,
+                             fence_drv, GFP_KERNEL));
        xa_unlock_irqrestore(&adev->userq_xa, flags);
+       if (r)
+               goto free_seq64;
 
        userq->fence_drv = fence_drv;