From a487e0ffde98ffd04c28833cef30b311d9318b8a Mon Sep 17 00:00:00 2001 From: Kevin Sala Date: Thu, 22 Dec 2022 01:41:50 +0100 Subject: [PATCH] [NFC][OpenMP][libomptarget] Return null if error detected during allocation in NextGen AMDGPU --- openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp index 901b997..73e3bd3 100644 --- a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp +++ b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp @@ -2535,6 +2535,7 @@ void *AMDGPUDeviceTy::allocate(size_t Size, void *, TargetAllocTy Kind) { // Enable all kernel agents to access the host pinned buffer. if (auto Err = MemoryPool->enableAccess(Alloc, Size, KernelAgents)) { REPORT("%s\n", toString(std::move(Err)).data()); + return nullptr; } // Keep track of the host pinned allocations for optimizations in transfers. -- 2.7.4