radeonsi: add missing threaded_resource_deinit calls in fail paths

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10813>
This commit is contained in:
Marek Olšák
2021-05-17 11:02:54 -04:00
committed by Marge Bot
parent 64b75cc12e
commit 27c9e77c6a
+2
View File
@@ -604,6 +604,7 @@ static struct pipe_resource *si_buffer_create(struct pipe_screen *screen,
buf->flags |= RADEON_FLAG_SPARSE;
if (!si_alloc_resource(sscreen, buf)) {
threaded_resource_deinit(&buf->b.b);
FREE(buf);
return NULL;
}
@@ -651,6 +652,7 @@ static struct pipe_resource *si_buffer_from_user_memory(struct pipe_screen *scre
/* Convert a user pointer to a buffer. */
buf->buf = ws->buffer_from_ptr(ws, user_memory, templ->width0);
if (!buf->buf) {
threaded_resource_deinit(&buf->b.b);
FREE(buf);
return NULL;
}