diff --git a/nvmed/src/main.rs b/nvmed/src/main.rs index 5cc55d21a3..87c1fa9498 100644 --- a/nvmed/src/main.rs +++ b/nvmed/src/main.rs @@ -85,7 +85,10 @@ fn get_int_method( &mut Some(ref bar) => Ok(bar.ptr), bar_to_set @ &mut None => { let bar = match function.bars[bir] { - PciBar::Memory(addr) => addr, + PciBar::Memory(addr) => match addr { + 0 => panic!("BAR {} is mapped to address 0", bir), + _ => addr, + }, other => panic!("Expected memory BAR, found {:?}", other), }; let bar_size = function.bar_sizes[bir]; @@ -271,7 +274,7 @@ fn main() { let bar = match pci_config.func.bars[0] { PciBar::Memory(mem) => match mem { - 0 => panic!("BAR is mapped to address 0"), + 0 => panic!("BAR 0 is mapped to address 0"), _ => mem, }, other => panic!("received a non-memory BAR ({:?})", other), diff --git a/xhcid/src/main.rs b/xhcid/src/main.rs index f64af404af..26c57fc349 100644 --- a/xhcid/src/main.rs +++ b/xhcid/src/main.rs @@ -102,7 +102,7 @@ fn main() { let bar_ptr = match bar { pcid_interface::PciBar::Memory(ptr) => match ptr { - 0 => panic!("BAR is mapped to address 0"), + 0 => panic!("BAR 0 is mapped to address 0"), _ => ptr, }, other => panic!("Expected memory bar, found {}", other),