drm/nouveau: prevent oops if no mmu subdev present
authorBen Skeggs <bskeggs@redhat.com>
Sat, 9 Jul 2016 00:41:01 +0000 (10:41 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 14 Jul 2016 01:53:25 +0000 (11:53 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drm.c

index 295e7621cc686ff1a242203fcea83a350ebfcd6d..6164ea08681911dc3ed4e9dc00d5a0ea8f577ba7 100644 (file)
@@ -430,6 +430,11 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
        nouveau_vga_init(drm);
 
        if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
+               if (!nvxx_device(&drm->device)->mmu) {
+                       ret = -ENOSYS;
+                       goto fail_device;
+               }
+
                ret = nvkm_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40),
                                  0x1000, NULL, &drm->client.vm);
                if (ret)