Skip to content

Commit 491254f

Browse files
Ben SkeggsDanilo Krummrich
authored andcommitted
drm/nouveau/nvif: fix null ptr deref on pre-fermi boards
Check that gpfifo.post() exists before trying to call it. Fixes: 862450a ("drm/nouveau/gf100-: track chan progress with non-WFI semaphore release") Reported-by: Jamie Heilman <jamie@audible.transient.net> Closes: https://lore.kernel.org/lkml/aElJIo9_Se6tAR1a@audible.transient.net/ Reported-by: Rui Salvaterra <rsalvaterra@gmail.com> Closes: https://lore.kernel.org/all/CALjTZvZgH0N43rMTcZiDVSX93PFL680hsYPwtp8=Ja1OWPvZ1A@mail.gmail.com/ Tested-by: Rui Salvaterra <rsalvaterra@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> Link: https://lore.kernel.org/r/20250714025923.29591-1-bskeggs@nvidia.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
1 parent 1918e79 commit 491254f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • drivers/gpu/drm/nouveau/nvif

drivers/gpu/drm/nouveau/nvif/chan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ nvif_chan_gpfifo_post(struct nvif_chan *chan)
3939
const u32 pbptr = (chan->push.cur - map) + chan->func->gpfifo.post_size;
4040
const u32 gpptr = (chan->gpfifo.cur + 1) & chan->gpfifo.max;
4141

42+
if (!chan->func->gpfifo.post)
43+
return 0;
44+
4245
return chan->func->gpfifo.post(chan, gpptr, pbptr);
4346
}
4447

0 commit comments

Comments
 (0)