From b967399ceab25911e9737262b0836c6908bcf1f0 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 22 Jan 2020 08:40:11 +0100 Subject: [PATCH] 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: (cherry picked from commit bd51538d285ad0ef488df60e24eaa08b9da20c28) --- .pick_status.json | 2 +- src/amd/vulkan/radv_device.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e1236585d15..996507ae72b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1282,7 +1282,7 @@ "description": "radv: fix double free corruption in radv_alloc_memory()", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "825ddfee59945e00845637262fba05975f7d16a4" }, diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 2db0cc9ac96..8a0f8f4c249 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -4736,7 +4736,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; } -- 2.11.0