summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/frontends/clover/api/memory.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/frontends/clover/api/memory.cpp b/src/gallium/frontends/clover/api/memory.cpp
index 062fbb98c5b..ea553efe1f4 100644
--- a/src/gallium/frontends/clover/api/memory.cpp
+++ b/src/gallium/frontends/clover/api/memory.cpp
@@ -609,7 +609,9 @@ clSVMAlloc(cl_context d_ctx,
void *ptr = nullptr;
if (alignment < sizeof(void*))
alignment = sizeof(void*);
- posix_memalign(&ptr, alignment, size);
+ int ret = posix_memalign(&ptr, alignment, size);
+ if (ret)
+ return nullptr;
if (ptr)
ctx.add_svm_allocation(ptr, size);