From: Samuel Pitoiset Date: Wed, 22 Jan 2020 07:40:11 +0000 (+0100) Subject: radv: fix double free corruption in radv_alloc_memory() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd51538d285ad0ef488df60e24eaa08b9da20c28;p=mesa.git radv: fix double free corruption in radv_alloc_memory() If the driver fails to allocate memory for some reasons, it shouldn't free the 'mem' object twice. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2302 Fixes: 825ddfee599 ("radv: Handle device memory alloc failure with normal free.") Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Tested-by: Marge Bot Part-of: --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index c3ff31668aa..2b222d331a3 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -5063,7 +5063,6 @@ static VkResult radv_alloc_memory(struct radv_device *device, fail: radv_free_memory(device, pAllocator,mem); - vk_free2(&device->alloc, pAllocator, mem); return result; }