nouveau: Fix null dereference in nouveau_pushbuf_destroy

This may happen if the Nouveau device fails to initialize before
the pushbuf is set up; the abort logic will call this either way.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21611>
(cherry picked from commit 9de997bde6)
This commit is contained in:
Sam Edwards 2023-02-28 22:46:30 +00:00 committed by Dylan Baker
parent 3a23a70875
commit 42a848a079
2 changed files with 3 additions and 1 deletions

View file

@ -3496,7 +3496,7 @@
"description": "nouveau: Fix null dereference in nouveau_pushbuf_destroy",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -241,6 +241,8 @@ nouveau_pushbuf_create(struct nouveau_screen *screen, struct nouveau_context *co
void
nouveau_pushbuf_destroy(struct nouveau_pushbuf **push)
{
if (!*push)
return;
FREE((*push)->user_priv);
nouveau_pushbuf_del(push);
}