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
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b6ecef28bfd7c1c267442fae1c8f2fe0f699f617)

Details

Provenance
markjAuthored on Aug 14 2022, 3:57 PM
Parents
rGe6b7a23d7faa: bhyve: Address -Wunused* warnings in pci_nvme.c
Branches
Unknown
Tags
Unknown