radv: fix double free corruption in radv_alloc_memory()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Jan 2020 07:40:11 +0000 (08:40 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Jan 2020 17:01:16 +0000 (17:01 +0000)
commitbd51538d285ad0ef488df60e24eaa08b9da20c28
treed7b01775f1b65c278159cb78c52276e527d58c37
parent5a6a88f58ce23de1d0caddb26e456d89a08321a5
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@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@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