git: 7376c08cc67e - main - bhyve nvme: Fix uninitialized pointer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 14 Aug 2022 15:04:08 UTC
The branch main has been updated by chuck:
URL: https://cgit.FreeBSD.org/src/commit/?id=7376c08cc67e65ee660d51873129e34745ef5dd4
commit 7376c08cc67e65ee660d51873129e34745ef5dd4
Author: Chuck Tuffli <chuck@FreeBSD.org>
AuthorDate: 2022-06-09 20:05:46 +0000
Commit: Chuck Tuffli <chuck@FreeBSD.org>
CommitDate: 2022-08-14 14:53:22 +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>
---
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 46a8104be9f6..92d4ce286940 100644
--- a/usr.sbin/bhyve/pci_nvme.c
+++ b/usr.sbin/bhyve/pci_nvme.c
@@ -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;