From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2056.outbound.protection.outlook.com [40.107.95.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0E2810E069 for ; Fri, 5 Jan 2024 05:18:40 +0000 (UTC) From: Jesse Zhang To: Subject: [PATCH i-g-t] tests/amdgpu:fix vm test issue Date: Fri, 5 Jan 2024 13:18:28 +0800 Message-ID: <20240105051828.3679085-1-jesse.zhang@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , Christian Koenig Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: Initialize the variable "r" before using it. Cc: Vitaly Prosyak Cc: Alex Deucher Cc: Christian Koenig Cc: Kamil Konieczny Signed-off-by: Jesse Zhang --- 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..bb7b6f173 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 (-ENOMEM == r) { /* Try allocate on the device of small memory */ request.alloc_size = 8ULL << 20; map_size = (8ULL << 20) - (2 << 12); -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 i-g-t] tests/amdgpu:fix vm test issue Date: Fri, 5 Jan 2024 13:18:28 +0800 Message-ID: <20240105051828.3679085-1-jesse.zhang@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: <20240105051828.5j8BK8Pb_jYZnYUttH-NvISFxGPtCUrqj-uJ0ycFq8U@z> Initialize the variable "r" before using it. Cc: Vitaly Prosyak Cc: Alex Deucher Cc: Christian Koenig Cc: Kamil Konieczny Signed-off-by: Jesse Zhang --- 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..bb7b6f173 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 (-ENOMEM == r) { /* Try allocate on the device of small memory */ request.alloc_size = 8ULL << 20; map_size = (8ULL << 20) - (2 << 12); -- 2.25.1