Remove dead code and fix null deref if vm is not found.
authordv <dv@openbsd.org>
Sun, 4 Feb 2024 14:57:00 +0000 (14:57 +0000)
committerdv <dv@openbsd.org>
Sun, 4 Feb 2024 14:57:00 +0000 (14:57 +0000)
commit58ab889669d004f1ee194afc2c3ecf5589735266
tree60de2b6591bba7bf6df78131c85178629068f5de
parent25a75e1b64e888aa4dc233efdd7ac52a0b73e324
Remove dead code and fix null deref if vm is not found.

Return early if no vm is found in vmd(8)'s primary vm fork/exec
function, preventing null deref in the 'fail' section. Also remove
inner return from the parent routine to prevent unreachable code.

Found by smatch, reported by and ok jsg@.
usr.sbin/vmd/vmm.c