From 27c9e77c6a2ea18037d7ba7698312ec3464f38f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 17 May 2021 11:02:54 -0400 Subject: [PATCH] radeonsi: add missing threaded_resource_deinit calls in fail paths Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_buffer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 9db2aa2..f9945a8 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -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; } -- 2.7.4