From 7e8e95f79bbc8ef68e07690d835edd2334af50e0 Mon Sep 17 00:00:00 2001 From: JaeHoon Lee Date: Wed, 17 Jun 2026 02:48:33 +0000 Subject: [PATCH] v3d: release the texture reference if shadow resource creation fails v3d_create_sampler_view() takes a reference on the texture before setting up the view, but the shadow resource error path frees the view without releasing it. Release the reference before bailing so the texture reference count stays balanced. Signed-off-by: JaeHoon Lee Reviewed-by: Iago Toral Quiroga Part-of: --- src/gallium/drivers/v3d/v3dx_state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/v3d/v3dx_state.c b/src/gallium/drivers/v3d/v3dx_state.c index baa9196c674..0ce11c17a7e 100644 --- a/src/gallium/drivers/v3d/v3dx_state.c +++ b/src/gallium/drivers/v3d/v3dx_state.c @@ -1175,6 +1175,7 @@ v3d_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc, */ prsc = v3d_resource_create(pctx->screen, &tmpl); if (!prsc) { + pipe_resource_reference(&so->base.texture, NULL); free(so); return NULL; }