From 307a312df9c43fdea286ad17f748aaf777cc434a Mon Sep 17 00:00:00 2001 From: Jon Derrick Date: Fri, 15 Mar 2019 18:05:15 -0600 Subject: [PATCH] drm/nouveau/bar/nv50: check bar1 vmm return value Check bar1's new vmm creation return value for errors. Signed-off-by: Jon Derrick Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c index 157b076a1272..8e64b19f3f8a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c @@ -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; -- 2.30.2