Mesa (master): iris: Fix major resource leak in iris_set_shader_images

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 28 02:49:24 UTC 2019


Module: Mesa
Branch: master
Commit: bed305fb7a1ad8d887fc6fa64e79e30cbd03bba1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bed305fb7a1ad8d887fc6fa64e79e30cbd03bba1

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Jun 27 16:54:47 2019 -0700

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.

---

 src/gallium/drivers/iris/iris_state.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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);
 




More information about the mesa-commit mailing list