Make sure 'out' is initialized to 0 before adding flags.
authortobhe <tobhe@openbsd.org>
Tue, 11 Jan 2022 20:34:22 +0000 (20:34 +0000)
committertobhe <tobhe@openbsd.org>
Tue, 11 Jan 2022 20:34:22 +0000 (20:34 +0000)
ok dv@ mlarkin@

sys/arch/amd64/amd64/vmm.c

index 844f444..edf7673 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vmm.c,v 1.300 2022/01/02 05:00:28 jsg Exp $   */
+/*     $OpenBSD: vmm.c,v 1.301 2022/01/11 20:34:22 tobhe Exp $ */
 /*
  * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
  *
@@ -3926,6 +3926,8 @@ vcpu_vmx_compute_ctrl(uint64_t ctrlval, uint16_t ctrl, uint32_t want1,
 {
        int i, set, clear;
 
+       *out = 0;
+
        /*
         * The Intel SDM gives three formulae for determining which bits to
         * set/clear for a given control and desired functionality. Formula