From 98faa09bb5a0828762bc5e7834a434797d9aa86f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 28 Jun 2021 19:11:46 -0500 Subject: [PATCH] iris: Don't leak the surface if uncompressed re-interp fails Fixes: a032a9665f27 "iris: Enable PIPE_CAP_SURFACE_REINTERPRET_BLOCKS" Reviewed-by: Kenneth Graunke Part-of: --- 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,