diff --git a/hipamd/src/hip_hmm.cpp b/hipamd/src/hip_hmm.cpp index 908e030d87..c6e5733b2a 100644 --- a/hipamd/src/hip_hmm.cpp +++ b/hipamd/src/hip_hmm.cpp @@ -89,7 +89,7 @@ hipError_t hipMemPrefetchAsync(const void* dev_ptr, size_t count, int device, size_t offset = 0; amd::Memory* memObj = getMemoryObject(dev_ptr, offset); - if (memObj == nullptr || (memObj && count > (memObj->getSize() - offset))) { + if ((memObj != nullptr) && (count > (memObj->getSize() - offset))) { HIP_RETURN(hipErrorInvalidValue); } if (device != hipCpuDeviceId && (static_cast(device) >= g_devices.size())) {