From 0064fac887d567faa362744f1550140972fb238b Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Fri, 2 Jun 2023 10:46:55 +0000 Subject: [PATCH] SWDEV-403762 - Fill pciBusId even if len <=12. Change-Id: Iaf1b3314f4ae5597d42d54eb4c977667ecbb9cfb --- hipamd/src/hip_device_runtime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_device_runtime.cpp b/hipamd/src/hip_device_runtime.cpp index ed6c119463..481daf534b 100644 --- a/hipamd/src/hip_device_runtime.cpp +++ b/hipamd/src/hip_device_runtime.cpp @@ -437,7 +437,7 @@ hipError_t hipDeviceGetPCIBusId ( char* pciBusId, int len, int device ) { } //pciBusId should be large enough to store 13 characters including the NULL-terminator. - if (pciBusId == nullptr || len <= 12) { + if (pciBusId == nullptr) { HIP_RETURN(hipErrorInvalidValue); } @@ -448,7 +448,7 @@ hipError_t hipDeviceGetPCIBusId ( char* pciBusId, int len, int device ) { prop.pciBusID, prop.pciDeviceID); - HIP_RETURN(hipSuccess); + HIP_RETURN(len <= 12 ? hipErrorInvalidValue : hipSuccess); } hipError_t hipDeviceGetSharedMemConfig ( hipSharedMemConfig * pConfig ) {