提交 12e08beb 编写于 作者: J Jon Derrick 提交者: Ben Skeggs

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: NJon Derrick <jonathan.derrick@intel.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 f10b83de
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册