[AMD Official Use Only - General]

Reviewed-by: Alex Deucher <[email protected]>
________________________________
From: Yu, Lang <[email protected]>
Sent: Wednesday, September 6, 2023 7:42 AM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Gopalakrishnan, 
Veerabadhran (Veera) <[email protected]>; Yu, Lang 
<[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] drm/amdgpu: fix unsigned error codes

Fixes: 77b13b916728 ("drm/amdgpu: add selftest framework for UMSCH")

Signed-off-by: Lang Yu <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/all/ZPhddADtKmOuVyDq@lang-desktop
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
index 284643e1efeb..9da80b54d63e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
@@ -335,11 +335,10 @@ static int setup_umsch_mm_test(struct amdgpu_device *adev,
         if (r)
                 goto error_free_vm;

-       test->pasid = amdgpu_pasid_alloc(16);
-       if (test->pasid < 0) {
-               r = test->pasid;
+       r = amdgpu_pasid_alloc(16);
+       if (r < 0)
                 goto error_fini_vm;
-       }
+       test->pasid = r;

         r = amdgpu_bo_create_kernel(adev, sizeof(struct 
umsch_mm_test_ctx_data),
                                     PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
--
2.25.1

Reply via email to