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 <dlwognsdc610@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42169>
This commit is contained in:
JaeHoon Lee 2026-06-17 02:48:33 +00:00 committed by Marge Bot
parent 8d17c7e282
commit 7e8e95f79b

View file

@ -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;
}