drm/nouveau/bar/nv50: check bar1 vmm return value
authorJon Derrick <jonathan.derrick@intel.com>
Sat, 16 Mar 2019 00:05:15 +0000 (18:05 -0600)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 1 May 2019 01:08:39 +0000 (11:08 +1000)
Check bar1's new vmm creation return value for errors.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c

index 157b076a1272300f648cd0502eafee675f69f270..8e64b19f3f8adf6e94a6b040f8d2346a8eb1a541 100644 (file)
@@ -168,6 +168,8 @@ nv50_bar_oneinit(struct nvkm_bar *base)
 
        ret = nvkm_vmm_new(device, start, limit-- - start, NULL, 0,
                           &bar1_lock, "bar1", &bar->bar1_vmm);
+       if (ret)
+               return ret;
 
        atomic_inc(&bar->bar1_vmm->engref[NVKM_SUBDEV_BAR]);
        bar->bar1_vmm->debug = bar->base.subdev.debug;