Skip to contentSkip to conversation

drm/nouveau/nvif: fix null ptr deref on pre-fermi boards

PATCH Applied Ben Skeggs 2 participants 2 messages Jul 14, 2025 – Jul 21, 2025

Subsystems (3)
lore
Share & tools
lore

Ben Skeggs

author
#0 lore raw

PATCH 1/1 drm/nouveau/nvif: fix null ptr deref on pre-fermi boards

Check that gpfifo.post() exists before trying to call it.

Fixes 862450a85b85 ("drm/nouveau/gf100-: track chan progress with non-WFI semaphore release")
---
 drivers/gpu/drm/nouveau/nvif/chan.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvif/chan.c +3 -0
index baa10227d51a..80c01017d642 100644
@@ -39,6 +39,9 @@ nvif_chan_gpfifo_post(struct nvif_chan *chan)
 	const u32 pbptr = (chan->push.cur - map) + chan->func->gpfifo.post_size;
 	const u32 gpptr = (chan->gpfifo.cur + 1) & chan->gpfifo.max;
 
+	if (!chan->func->gpfifo.post)
+		return 0;
+
 	return chan->func->gpfifo.post(chan, gpptr, pbptr);
 }
 
Signature · 1 line
2.49.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Ben Skeggs

Check that gpfifo.post() exists before trying to call it.

Fixes 862450a85b85 ("drm/nouveau/gf100-: track chan progress with non-WFI semaphore release")

Please remember to add a Closes tag for Reported-by (I added them when I applied the patch).

Applied to drm-misc-fixes, thanks!