bhyve nvme: Fix uninitialized pointer

The Dataset Management code could free an uninitialized pointer if the
device doesn't support the Dataset Management command.

PR:		264548
Reported by:	Robert Morris <rtm@lcs.mit.edu>
This commit is contained in:
Chuck Tuffli 2022-06-09 13:05:46 -07:00
parent d7d1becad4
commit 7376c08cc6

View File

@ -2597,7 +2597,7 @@ nvme_opc_dataset_mgmt(struct pci_nvme_softc *sc,
struct pci_nvme_ioreq *req,
uint16_t *status)
{
struct nvme_dsm_range *range;
struct nvme_dsm_range *range = NULL;
uint32_t nr, r, non_zero, dr;
int err;
bool pending = false;