anv: add missing unlock in error path.
authorDave Airlie <airlied@redhat.com>
Thu, 4 Oct 2018 23:56:19 +0000 (09:56 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 10 Oct 2018 23:50:27 +0000 (09:50 +1000)
Not going to matter, but be consistent.

Found by coverity

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: caf41c78c (anv/allocator: Support softpin in the BO cache)
src/intel/vulkan/anv_allocator.c

index f62d48ae3fe37af626c4e17a3e6091225f5ba74d..67f2f73aa11dda19c57e34f91069dc7937e1c7e8 100644 (file)
@@ -1358,6 +1358,7 @@ anv_bo_cache_import(struct anv_device *device,
       if ((new_flags & EXEC_OBJECT_PINNED) &&
           (bo->bo.flags & EXEC_OBJECT_SUPPORTS_48B_ADDRESS) !=
           (bo_flags & EXEC_OBJECT_SUPPORTS_48B_ADDRESS)) {
+         pthread_mutex_unlock(&cache->mutex);
          return vk_errorf(device->instance, NULL,
                           VK_ERROR_INVALID_EXTERNAL_HANDLE,
                           "The same BO was imported on two different heaps");