]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Address uses of uninitialized variables in pci_nvme.c
authorMark Johnston <markj@FreeBSD.org>
Sun, 14 Aug 2022 15:57:24 +0000 (11:57 -0400)
committerMark Johnston <markj@FreeBSD.org>
Sun, 14 Aug 2022 15:59:01 +0000 (11:59 -0400)
commitb6ecef28bfd7c1c267442fae1c8f2fe0f699f617
treec84e324e03b935a2b721383777ee8a41bada680e
parentaf86d12c80f10dcd4a57ff7834891890b255087d
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
usr.sbin/bhyve/pci_nvme.c