diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -615,9 +615,6 @@ error = register_inout(&iop); } else error = unregister_inout(&iop); - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; case PCIBAR_MEM32: case PCIBAR_MEM64: @@ -633,21 +630,18 @@ error = register_mem(&mr); } else error = unregister_mem(&mr); - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; case PCIBAR_ROM: error = 0; - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; default: error = EINVAL; break; } assert(error == 0); + + if (pe->pe_baraddr != NULL) + (*pe->pe_baraddr)(pi, idx, registration, pi->pi_bar[idx].addr); } static void