HomeFreeBSD

vmm: don't free unallocated memory

Description

vmm: don't free unallocated memory

If vmx or svm is disabled in BIOS or the device isn't supported by vmm,
modinit won't allocate these state save areas. As kmem_free panics when
passing a NULL pointer to it, loading the vmm kernel module causes a
panic too.

PR: 271251
Reviewed by: markj
Fixes: 74ac712f72cfd6d7b3db3c9d3b72ccf2824aa183 ("vmm: Dynamically allocate a couple of per-CPU state save areas")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39974

(cherry picked from commit b10e100d1696782cfebef09b5870dfc6d1b3217b)

Details

Provenance
corvinkAuthored on May 10 2023, 1:19 PM
markjCommitted on May 11 2023, 1:32 PM
Reviewer
rG74ac712f72cf: vmm: Dynamically allocate a couple of per-CPU state save areas
Differential Revision
D39974: vmm: don't free unallocated memory
Parents
rG0a300a95c10f: vmm: Dynamically allocate a couple of per-CPU state save areas
Branches
Unknown
Tags
Unknown