Mesa (master): radv: fix double free corruption in radv_alloc_memory()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 22 17:21:02 UTC 2020


Module: Mesa
Branch: master
Commit: bd51538d285ad0ef488df60e24eaa08b9da20c28
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bd51538d285ad0ef488df60e24eaa08b9da20c28

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Jan 22 08:40:11 2020 +0100

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 <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3508>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3508>

---

 src/amd/vulkan/radv_device.c | 1 -
 1 file changed, 1 deletion(-)

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;
 }



More information about the mesa-commit mailing list