drm/nouveau/ttm: avoid using nouveau_drm.ttm.type_vram prior to nv50
authorBen Skeggs <bskeggs@redhat.com>
Sat, 14 Nov 2020 03:50:44 +0000 (13:50 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Sat, 14 Nov 2020 04:19:17 +0000 (14:19 +1000)
commit6c27ffabeb19ebf7dd6d4ccc29f1e57d1ef445d8
tree67b0a4907979a5a83cd40c15f72e2ced08991808
parent630f512280604eecae0ddc2b3f8402f7931c56fd
drm/nouveau/ttm: avoid using nouveau_drm.ttm.type_vram prior to nv50

Pre-NV50 chipsets don't currently use the MMU subsystem that later
chipsets use, and type_vram is negative here, leading to an OOB memory
access.

This was previously guarded by a chipset check, restore that.

Reported-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 5839172f0980 ("drm/nouveau: explicitly specify caching to use")
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bo.c