From e829ef68e44988e5b6a2aefeee043b36421b036f Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Wed, 10 Apr 2024 11:35:54 +0000 Subject: [PATCH] SWDEV-455869 - Revert "SWDEV-410751 - Consider null amd::memory is invalid." This reverts commit a9ff2c5a43deda8fa7e942b70c1e3541281ad8c6. Change-Id: I26c4b3c74b2861afc17f979492d025b59d4388ab --- hipamd/src/hip_hmm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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())) {