From 1cee1baac258d77eb6ecbcff8aab51cbd1806426 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Tue, 21 May 2024 01:04:55 -0500 Subject: [PATCH] Make product name empty when unable to find pciid Signed-off-by: Maisam Arif Change-Id: If2300bf2deb4fa099db695949bd4c74393dbbbfc --- src/amd_smi/amd_smi.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index daa809247a..5fcee46eff 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -440,6 +440,13 @@ amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_hand status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, board_info->product_name, AMDSMI_256_LENGTH); + // Check if the value is in hex format + if (status == AMDSMI_STATUS_SUCCESS) { + if (board_info->product_name[0] == '0' && board_info->product_name[1] == 'x') { + memset(board_info->product_name, 0, + AMDSMI_256_LENGTH * sizeof(board_info->product_name[0])); + } + } if (status != AMDSMI_STATUS_SUCCESS) { memset(board_info->product_name, 0, AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));