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>
This commit is contained in:
Sam Edwards 2023-02-28 22:46:30 +00:00 committed by Marge Bot
parent 34d45df8ff
commit 9de997bde6

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);
}