aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/iris/iris_bufmgr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index 5bf52b32eeb..c8e6d0c654b 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -980,6 +980,10 @@ iris_bo_map_cpu(struct pipe_debug_callback *dbg,
if (!bo->map_cpu) {
DBG("iris_bo_map_cpu: %d (%s)\n", bo->gem_handle, bo->name);
void *map = iris_bo_gem_mmap(dbg, bo, false);
+ if (!map) {
+ return NULL;
+ }
+
VG_DEFINED(map, bo->size);
if (p_atomic_cmpxchg(&bo->map_cpu, NULL, map)) {
@@ -1027,6 +1031,10 @@ iris_bo_map_wc(struct pipe_debug_callback *dbg,
if (!bo->map_wc) {
DBG("iris_bo_map_wc: %d (%s)\n", bo->gem_handle, bo->name);
void *map = iris_bo_gem_mmap(dbg, bo, true);
+ if (!map) {
+ return NULL;
+ }
+
VG_DEFINED(map, bo->size);
if (p_atomic_cmpxchg(&bo->map_wc, NULL, map)) {