Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: Jesse Zhang Subject: [PATCH] [PATCH i-g-t v2] tests/amdgpu/amd_vm: fix vm test issue Date: Mon, 8 Jan 2024 09:21:57 +0800 Message-ID: <20240108012157.3781758-1-jesse.zhang@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: To: igt-dev@lists.freedesktop.org Cc: Alex Deucher , Christian Koenig Message-ID: <20240108012157.QpOst2ly4OzhEGUTBVT27lJvAHvoajl6Ky2tMmET89c@z> Initialize the variable "r" before using it, in the subtest amdgpu-vm-unaligned-map. V2: --fix code style and description (Kamil and Christian). Cc: Vitaly Prosyak Cc: Alex Deucher Cc: Christian Koenig Cc: Kamil Konieczny Signed-off-by: Jesse Zhang Acked-by: Christian König --- tests/amdgpu/amd_vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/amdgpu/amd_vm.c b/tests/amdgpu/amd_vm.c index dab91f291..9cd56e2b5 100644 --- a/tests/amdgpu/amd_vm.c +++ b/tests/amdgpu/amd_vm.c @@ -127,7 +127,8 @@ amdgpu_vm_unaligned_map(amdgpu_device_handle device_handle) request.preferred_heap = AMDGPU_GEM_DOMAIN_VRAM; request.flags = AMDGPU_GEM_CREATE_NO_CPU_ACCESS; - if (-ENOMEM == amdgpu_bo_alloc(device_handle, &request, &buf_handle)) { + r = amdgpu_bo_alloc(device_handle, &request, &buf_handle); + if (r == -ENOMEM) { /* Try allocate on the device of small memory */ request.alloc_size = 8ULL << 20; map_size = (8ULL << 20) - (2 << 12); -- 2.25.1