From 1d967132f3c4aefa72224d1029aa64a34053bf6b Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Sun, 24 Jan 2021 20:53:36 +1300 Subject: [PATCH] panfrost: Use normal malloc/free instead of ralloc for surfaces Fixes a double-free in some Qt5 WebEngine apps (e.g. ghostwriter). Cc: mesa-stable Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index f93a3eaa600..a2f618ea550 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -243,7 +243,7 @@ panfrost_create_surface(struct pipe_context *pipe, { struct pipe_surface *ps = NULL; - ps = rzalloc(pipe, struct pipe_surface); + ps = CALLOC_STRUCT(pipe_surface); if (ps) { pipe_reference_init(&ps->reference, 1); @@ -279,7 +279,7 @@ panfrost_surface_destroy(struct pipe_context *pipe, { assert(surf->texture); pipe_resource_reference(&surf->texture, NULL); - ralloc_free(surf); + free(surf); } static struct pipe_resource *