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); }