From 9de997bde67df43a9e10a05f9b48419ee4cfec25 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 28 Feb 2023 22:46:30 +0000 Subject: [PATCH] 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 Reviewed-by: Karol Herbst Cc: mesa-stable Part-of: --- src/gallium/drivers/nouveau/nouveau_screen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index c6c8d664c11..4caa3df2801 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -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); }