mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
drm/nouveau/bar/gf100: ensure BAR is mapped
commit 12e08beb32 upstream.
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>
Signed-off-by: Sushma Kalakota <sushmax.kalakota@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e9f3e2ef01
commit
3579293f6b
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user