Browse Source

drm/nouveau: prevent oops if no mmu subdev present

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs 9 years ago
parent
commit
2100292c95
1 changed files with 5 additions and 0 deletions
  1. 5 0
      drivers/gpu/drm/nouveau/nouveau_drm.c

+ 5 - 0
drivers/gpu/drm/nouveau/nouveau_drm.c

@@ -430,6 +430,11 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
 	nouveau_vga_init(drm);
 	nouveau_vga_init(drm);
 
 
 	if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
 	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),
 		ret = nvkm_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40),
 				  0x1000, NULL, &drm->client.vm);
 				  0x1000, NULL, &drm->client.vm);
 		if (ret)
 		if (ret)