diff --git a/rocclr/platform/memory.cpp b/rocclr/platform/memory.cpp index 1edd79b3af..0b8d7e3ee7 100644 --- a/rocclr/platform/memory.cpp +++ b/rocclr/platform/memory.cpp @@ -329,7 +329,7 @@ bool Memory::addDeviceMemory(const Device* dev) { if (numDevices() == NumDevicesWithP2P()) { // Mark the allocation as an empty deviceAlloced_[dev].store(AllocInit, std::memory_order_release); - return false; + return result; } device::Memory* dm = dev->createMemory(*this); @@ -349,6 +349,7 @@ bool Memory::addDeviceMemory(const Device* dev) { LogError("Video memory allocation failed!"); // Mark the allocation as an empty deviceAlloced_[dev].store(AllocInit, std::memory_order_release); + return result; } }