Fix AMD-SMI test segmentation fault TestGpuMetricsRead

Issue: need to return on any failure.
The nullptr check test would segfault without-
all values in struct are not initialized.

Signed-off-by: Charis Poag <Charis.Poag@amd.com>
Change-Id: I4987fb73ba9bcb182de7a439a4286333a41bf7eb
(cherry picked from commit d74be3120e)
This commit is contained in:
Charis Poag
2024-01-14 19:22:31 -06:00
parent b6f1bf80e9
commit c3b5d0a77a
+3
View File
@@ -1084,6 +1084,9 @@ amdsmi_status_t amdsmi_get_gpu_metrics_info(
amdsmi_status_t ret =
rsmi_wrapper(rsmi_dev_gpu_metrics_info_get, processor_handle,
reinterpret_cast<rsmi_gpu_metrics_t*>(pgpu_metrics));
if (ret != AMDSMI_STATUS_SUCCESS) {
return ret;
}
// WARNING: TEMPORARY - awaiting 1.5 update from amdgpu driver/firmware
// intended to be removed later
// START: REMOVE WHATS BELOW ME