diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 02af06d6bff2..5fc4c2af705a 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1746,6 +1746,8 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *opts) optidx++; } + free(uopt); + if (sc->nvstore.ctx == NULL || sc->nvstore.size == 0) { fprintf(stderr, "backing store not specified\n"); return (-1); @@ -1756,9 +1758,7 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *opts) sc->nvstore.sectsz = blockif_sectsz(sc->nvstore.ctx); for (sc->nvstore.sectsz_bits = 9; (1 << sc->nvstore.sectsz_bits) < sc->nvstore.sectsz; - sc->nvstore.sectsz_bits++) - ; - + sc->nvstore.sectsz_bits++); if (sc->max_queues == 0) { fprintf(stderr, "Invalid maxq option\n");