Fix an off-by-one error when iterating over the emulated PCI BARs.

Submitted by:	Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
This commit is contained in:
Neel Natu 2013-11-06 22:35:52 +00:00
parent d2e6c52931
commit c8afb9bc3f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257767

View File

@ -1252,7 +1252,7 @@ pci_emul_cmdwrite(struct pci_devinst *pi, uint32_t new, int bytes)
* If the MMIO or I/O address space decoding has changed then
* register/unregister all BARs that decode that address space.
*/
for (i = 0; i < PCI_BARMAX; i++) {
for (i = 0; i <= PCI_BARMAX; i++) {
switch (pi->pi_bar[i].type) {
case PCIBAR_NONE:
case PCIBAR_MEMHI64: