git: c84ec3076e7d - stable/13 - bhyve nvme: Fix uninitialized pointer

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Fri, 20 Jan 2023 21:08:03 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=c84ec3076e7de10d7475fd9694ad64603e264d88

commit c84ec3076e7de10d7475fd9694ad64603e264d88
Author:     Chuck Tuffli <chuck@FreeBSD.org>
AuthorDate: 2022-06-09 20:05:46 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-01-20 21:07:27 +0000

    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>
    
    (cherry picked from commit 7376c08cc67e65ee660d51873129e34745ef5dd4)
---
 usr.sbin/bhyve/pci_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c
index 9704081c12af..da19bef1b779 100644
--- a/usr.sbin/bhyve/pci_nvme.c
+++ b/usr.sbin/bhyve/pci_nvme.c
@@ -2598,7 +2598,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;