Skip to content
Snippets Groups Projects
Commit 5f8e0c71 authored by Faith Ekstrand's avatar Faith Ekstrand :speech_balloon: Committed by Dylan Baker
Browse files

anv: Fix a potential BO handle leak


Fixes: 731c4adc "anv/allocator: Add support for non-userptr"
Reviewed-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit bb257e18)
parent f0104d8f
No related branches found
No related tags found
No related merge requests found
......@@ -532,9 +532,11 @@ anv_block_pool_expand_range(struct anv_block_pool *pool,
if (use_softpin) {
gem_handle = anv_gem_create(pool->device, newbo_size);
map = anv_gem_mmap(pool->device, gem_handle, 0, newbo_size, 0);
if (map == MAP_FAILED)
if (map == MAP_FAILED) {
anv_gem_close(pool->device, gem_handle);
return vk_errorf(pool->device->instance, pool->device,
VK_ERROR_MEMORY_MAP_FAILED, "gem mmap failed: %m");
}
assert(center_bo_offset == 0);
} else {
/* Just leak the old map until we destroy the pool. We can't munmap it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment