Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12e08beb authored by Jon Derrick's avatar Jon Derrick Committed by Ben Skeggs
Browse files

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: default avatarJon Derrick <jonathan.derrick@intel.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f10b83de
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;