From b07a44c253ec5a624804ced3d93bf8345a7746ea Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Fri, 19 May 2023 09:28:38 +0000 Subject: [PATCH] SWDEV-401231 - getMemoryObject returns nullptr for host system memory as arena is disabled for XNACK. Change-Id: I84348e0ba2debf69f65c0e85179dad7827d30806 --- hipamd/src/hip_hmm.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hipamd/src/hip_hmm.cpp b/hipamd/src/hip_hmm.cpp index ec201663f6..d38543285f 100644 --- a/hipamd/src/hip_hmm.cpp +++ b/hipamd/src/hip_hmm.cpp @@ -147,11 +147,7 @@ hipError_t hipMemAdvise(const void* dev_ptr, size_t count, hipMemoryAdvise advic size_t offset = 0; amd::Memory* memObj = getMemoryObject(dev_ptr, offset); - if (memObj == nullptr) { - HIP_RETURN(hipErrorMemoryAllocation); - } - - if (count > (memObj->getSize() - offset)) { + if (memObj && count > (memObj->getSize() - offset)) { HIP_RETURN(hipErrorInvalidValue); }