From b845e54da4383f6b8adb4a0a8c66c00721ca09c1 Mon Sep 17 00:00:00 2001 From: tobhe Date: Tue, 11 Jan 2022 20:34:22 +0000 Subject: [PATCH] Make sure 'out' is initialized to 0 before adding flags. ok dv@ mlarkin@ --- sys/arch/amd64/amd64/vmm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 844f444d7b4..edf767341d3 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -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 * @@ -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 -- 2.20.1