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 <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Reported-by: Rui Salvaterra <[email protected]> Closes: https://lore.kernel.org/all/CALjTZvZgH0N43rMTcZiDVSX93PFL680hsYPwtp8=Ja1OWPvZ1A@mail.gmail.com/ Tested-by: Rui Salvaterra <[email protected]> Signed-off-by: Ben Skeggs <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Danilo Krummrich <[email protected]>
1 parent 1918e79 commit 491254f

File tree

1 file changed

+3
-0
lines changed
  • drivers/gpu/drm/nouveau/nvif

1 file changed

+3
-0
lines changed

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)