]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: fix unsigned error codes
authorLang Yu <Lang.Yu@amd.com>
Wed, 6 Sep 2023 11:15:45 +0000 (19:15 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 Sep 2023 21:09:12 +0000 (17:09 -0400)
Fixes: 5d5eac7e8303 ("drm/amdgpu: add selftest framework for UMSCH")
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/all/ZPhddADtKmOuVyDq@lang-desktop
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c

index 7341808a3558d4fdd3fb3d7ea1cd5d8a11dc05d3..562ed4e937ba9740b78263cf5665f8416e9a0ab0 100644 (file)
@@ -334,11 +334,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,