Mesa (main): iris: Don't leak the surface if uncompressed re-interp fails

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 6 19:42:51 UTC 2021


Module: Mesa
Branch: main
Commit: 98faa09bb5a0828762bc5e7834a434797d9aa86f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=98faa09bb5a0828762bc5e7834a434797d9aa86f

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Mon Jun 28 19:11:46 2021 -0500

iris: Don't leak the surface if uncompressed re-interp fails

Fixes: a032a9665f27 "iris: Enable PIPE_CAP_SURFACE_REINTERPRET_BLOCKS"
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>

---

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

diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 0d4c7650793..7242d7f41e4 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -2639,8 +2639,10 @@ iris_create_surface(struct pipe_context *ctx,
        *
        * Return NULL to force gallium frontends to take fallback paths.
        */
-      if (view->array_len > 1 || GFX_VER == 8)
+      if (view->array_len > 1 || GFX_VER == 8) {
+         free(surf);
          return NULL;
+      }
 
       const bool is_3d = res->surf.dim == ISL_SURF_DIM_3D;
       isl_surf_get_image_surf(&screen->isl_dev, &res->surf,



More information about the mesa-commit mailing list