From: Kenneth Graunke Date: Thu, 27 Jun 2019 23:54:47 +0000 (-0700) Subject: iris: Fix major resource leak in iris_set_shader_images X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bed305fb7a1ad8d887fc6fa64e79e30cbd03bba1;p=mesa.git iris: Fix major resource leak in iris_set_shader_images We were failing to unreference the old image resource. Instead of open coding this and doing it badly, just use the copier function which does the right thing. --- diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 01cd9dbcec7..e09a3ddbcc9 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2098,9 +2098,7 @@ iris_set_shader_images(struct pipe_context *ctx, if (!unlikely(map)) return; - iv->base = *img; - iv->base.resource = NULL; - pipe_resource_reference(&iv->base.resource, &res->base); + util_copy_image_view(&iv->base, img); shs->bound_image_views |= 1 << (start_slot + i);