anv: Add missing unlock in anv_scratch_pool_alloc
[mesa.git] / src / intel / vulkan / anv_allocator.c
index 33bd3c68c55f69e061a03eab05345bd5b75162c7..fe14d6cfabd1959cf89e141f2967bf89a97fabf8 100644 (file)
@@ -1088,8 +1088,10 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
    pthread_mutex_lock(&device->mutex);
 
    __sync_synchronize();
-   if (bo->exists)
+   if (bo->exists) {
+      pthread_mutex_unlock(&device->mutex);
       return &bo->bo;
+   }
 
    const struct anv_physical_device *physical_device =
       &device->instance->physicalDevice;