aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorJon Derrick <jonathan.derrick@intel.com>2019-03-15 18:05:17 -0600
committerBen Skeggs <bskeggs@redhat.com>2019-05-01 11:08:39 +1000
commit12e08beb32d64b6070b718630490db83dd321c8c (patch)
tree3a2b641dbcd53c85f5e81ca49e37099682344b7e /drivers/gpu/drm/nouveau
parentdrm/nouveau/bar/nv50: ensure BAR is mapped (diff)
downloadlinux-dev-12e08beb32d64b6070b718630490db83dd321c8c.tar.xz
linux-dev-12e08beb32d64b6070b718630490db83dd321c8c.zip
drm/nouveau/bar/gf100: ensure BAR is mapped
If the BAR is zero size, it indicates it was never successfully mapped. Ensure that the BAR is valid during initialization before attempting to use it. Signed-off-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
index a3ba7f50198b..a3dcb09a40ee 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
@@ -94,6 +94,8 @@ gf100_bar_oneinit_bar(struct gf100_bar *bar, struct gf100_barN *bar_vm,
return ret;
bar_len = device->func->resource_size(device, bar_nr);
+ if (!bar_len)
+ return -ENOMEM;
if (bar_nr == 3 && bar->bar2_halve)
bar_len >>= 1;