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 <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8678>
(cherry picked from commit 1d967132f3)
This commit is contained in:
Icecream95 2021-01-24 20:53:36 +13:00 committed by Dylan Baker
parent 79eb7c245d
commit e8b4805248
2 changed files with 3 additions and 3 deletions

View file

@ -274,7 +274,7 @@
"description": "panfrost: Use normal malloc/free instead of ralloc for surfaces",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -175,7 +175,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);
@ -211,7 +211,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 *