iris: fix a leak on surface states

Cc: mesa-stable
Closes:https://gitlab.freedesktop.org/mesa/mesa/-/issues/6013

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15010>
(cherry picked from commit ecc0041030)
This commit is contained in:
Tapani Pälli 2022-02-14 07:40:51 +02:00 committed by Eric Engestrom
parent 4eff8db4ea
commit f3cfbbd457
2 changed files with 2 additions and 1 deletions

View file

@ -2470,7 +2470,7 @@
"description": "iris: fix a leak on surface states",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -2934,6 +2934,7 @@ iris_surface_destroy(struct pipe_context *ctx, struct pipe_surface *p_surf)
pipe_resource_reference(&surf->surface_state.ref.res, NULL);
pipe_resource_reference(&surf->surface_state_read.ref.res, NULL);
free(surf->surface_state.cpu);
free(surf->surface_state_read.cpu);
free(surf);
}