summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Edwards <cfsworks@gmail.com>2023-02-28 22:46:30 +0000
committerEric Engestrom <eric@engestrom.ch>2023-03-08 18:00:16 +0000
commit4585f21de47af5e2b1a018a052ac0aaf5f1f3ac5 (patch)
tree2f2052cf19ba47da0f3d0b8a032d394554edebb6
parent64d830c0abc52917b5e46569a0a4ec1786a292f8 (diff)
downloadmesa-4585f21de47af5e2b1a018a052ac0aaf5f1f3ac5.tar.gz
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 9de997bde67df43a9e10a05f9b48419ee4cfec25)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 0ede418908e..cd158b078cf 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1417,7 +1417,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
},
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index bdd2b903dab..0daca9ea30c 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);
}