radv: Fix bufimage failure deallocation.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 21 Jan 2018 21:01:49 +0000 (22:01 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 21 Jan 2018 23:07:32 +0000 (00:07 +0100)
The inidividual init parts don't clean up their own stuff on failure.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_meta_bufimage.c

index 5bcc1e62dba1ce078288f80edbfe2194fccc3230..adf610a933e8da6d0e9d925fcc6bc24187f95301 100644 (file)
@@ -901,21 +901,23 @@ radv_device_init_meta_bufimage_state(struct radv_device *device)
 
        result = radv_device_init_meta_itob_state(device);
        if (result != VK_SUCCESS)
-               return result;
+               goto fail_itob;
 
        result = radv_device_init_meta_btoi_state(device);
        if (result != VK_SUCCESS)
-               goto fail_itob;
+               goto fail_btoi;
 
        result = radv_device_init_meta_itoi_state(device);
        if (result != VK_SUCCESS)
-               goto fail_btoi;
+               goto fail_itoi;
 
        result = radv_device_init_meta_cleari_state(device);
        if (result != VK_SUCCESS)
-               goto fail_itoi;
+               goto fail_cleari;
 
        return VK_SUCCESS;
+fail_cleari:
+       radv_device_finish_meta_cleari_state(device);
 fail_itoi:
        radv_device_finish_meta_itoi_state(device);
 fail_btoi: