Mesa (staging/21.0): anv/image: Fix cleanup of failed image creation
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 8 17:07:41 UTC 2021
Module: Mesa
Branch: staging/21.0
Commit: 12474ad0914e2783176ff31c0cd0033fbfaeba28
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=12474ad0914e2783176ff31c0cd0033fbfaeba28
Author: Chad Versace <chad at kiwitree.net>
Date: Thu Apr 1 11:34:23 2021 -0700
anv/image: Fix cleanup of failed image creation
In anv_image_create(), the failure path neglected to call
vk_object_base_finish().
CC: mesa-stable at lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1466>
(cherry picked from commit c21dc4101a5473f5a0ec17559a0305c61525de7a)
---
.pick_status.json | 2 +-
src/intel/vulkan/anv_image.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index e2b5d88c836..8359c2189d7 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -139,7 +139,7 @@
"description": "anv/image: Fix cleanup of failed image creation",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 21c5d5c3eef..659a8401f77 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -853,9 +853,8 @@ anv_image_create(VkDevice _device,
return VK_SUCCESS;
fail:
- if (image)
- vk_free2(&device->vk.alloc, alloc, image);
-
+ vk_object_base_finish(&image->base);
+ vk_free2(&device->vk.alloc, alloc, image);
return r;
}
More information about the mesa-commit
mailing list