]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: add missing error handling in function amdgpu_gmc_flush_gpu_tlb_pasid
authorBob Zhou <bob.zhou@amd.com>
Thu, 20 Jun 2024 07:40:06 +0000 (15:40 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2024 21:10:39 +0000 (17:10 -0400)
Fix the unchecked return value warning reported by Coverity,
so add error handling.

Signed-off-by: Bob Zhou <bob.zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

index 322b8ff67cde384e7331d0b5393115098512903d..3a762261191660466305c817dec964c79fac095c 100644 (file)
@@ -718,7 +718,11 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,
                        ndw += kiq->pmf->invalidate_tlbs_size;
 
                spin_lock(&adev->gfx.kiq[inst].ring_lock);
-               amdgpu_ring_alloc(ring, ndw);
+               r = amdgpu_ring_alloc(ring, ndw);
+               if (r) {
+                       spin_unlock(&adev->gfx.kiq[inst].ring_lock);
+                       goto error_unlock_reset;
+               }
                if (adev->gmc.flush_tlb_needs_extra_type_2)
                        kiq->pmf->kiq_invalidate_tlbs(ring, pasid, 2, all_hub);