v3dv: fix leak

Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17201>
This commit is contained in:
Iago Toral Quiroga
2022-06-22 11:44:12 +02:00
committed by Marge Bot
parent 1951065a16
commit 0bc65b1d81

View File

@@ -2533,8 +2533,10 @@ v3dv_CreateBuffer(VkDevice _device,
/* Limit allocations to 32-bit */
const VkDeviceSize aligned_size = align64(buffer->size, buffer->alignment);
if (aligned_size > UINT32_MAX || aligned_size < buffer->size)
if (aligned_size > UINT32_MAX || aligned_size < buffer->size) {
vk_free(&device->vk.alloc, buffer);
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
}
*pBuffer = v3dv_buffer_to_handle(buffer);