drm/nouveau/nvif: fix null ptr deref on pre-fermi boards
Subsystems (3)
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")
Reported-by Jamie Heilman <[email protected]>
Reported-by Rui Salvaterra <[email protected]>
Tested-by Rui Salvaterra <[email protected]>
Signed-off-by Ben Skeggs <[email protected]>
--- drivers/gpu/drm/nouveau/nvif/chan.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvif/chan.c +3 -0
@@ -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
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")Reported-by Jamie Heilman <[email protected]>Reported-by Rui Salvaterra <[email protected]>Tested-by Rui Salvaterra <[email protected]>Signed-off-by Ben Skeggs <[email protected]>
Please remember to add a Closes tag for Reported-by (I added them when I applied the patch).
Applied to drm-misc-fixes, thanks!