HomeFreeBSD

bhyve: Address uses of uninitialized variables in pci_nvme.c

Description

bhyve: Address uses of uninitialized variables in pci_nvme.c

The debug print in nvme_opc_get_log_page() would print an uninitialized
local variable.

In nvme_opc_write_read(), a failed LBA bounds check would cause
pci_nvme_stats_write_read_update() to be called with an uninitialized
variable as a parameter. Although the parameter is unused when the
check fails (and so status != 0), LLVM 14 emits some bogus machine code
in this path, which happens to result in a segfault when it gets
executed.

PR: 265749
Reviewed by: chuck, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36119

Details

Provenance
markjAuthored on Aug 14 2022, 3:57 PM
Reviewer
chuck
Differential Revision
D36119: bhyve: Fix uses of uninitialized variables in pci_nvme.c
Parents
rGaf86d12c80f1: bhyve: Address -Wunused* warnings in pci_nvme.c
Branches
Unknown
Tags
Unknown