From: Kenneth Graunke Date: Sun, 26 May 2019 22:57:55 +0000 (-0700) Subject: iris: Fix locking around vma_alloc in iris_bo_create_userptr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78003014d03e77ed48d33f32de5d940e81917b6b;p=mesa.git iris: Fix locking around vma_alloc in iris_bo_create_userptr util_vma needs to be protected by a lock. All other callers of vma_alloc and vma_free appear to be holding a lock already. Reviewed-by: Caio Marcelo de Oliveira Filho --- diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index d89351043df..1845e9898a0 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -581,7 +581,11 @@ iris_bo_create_userptr(struct iris_bufmgr *bufmgr, const char *name, bo->bufmgr = bufmgr; bo->kflags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_PINNED; + + mtx_lock(&bufmgr->lock); bo->gtt_offset = vma_alloc(bufmgr, memzone, size, 1); + mtx_unlock(&bufmgr->lock); + if (bo->gtt_offset == 0ull) goto err_close;