From: Tamas K Lengyel Date: Mon, 18 Jan 2021 17:23:06 +0000 (-0700) Subject: x86/mem_sharing: fix uninitialized 'preempted' variable X-Git-Tag: 4.15.0-rc1~273 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cb34a2fa162184b150d48a3b6f385bacbec22ce7;p=people%2Fjgross%2Fxen.git x86/mem_sharing: fix uninitialized 'preempted' variable UBSAN catches an uninitialized use of the 'preempted' variable in fork_hap_allocation when there is no preemption. Fixes: 41548c5472a ("mem_sharing: VM forking") Signed-off-by: Tamas K Lengyel Acked-by: Andrew Cooper --- diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index c8a6d11b90..adaeab4612 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1644,7 +1644,7 @@ static int copy_vcpu_settings(struct domain *cd, const struct domain *d) static int fork_hap_allocation(struct domain *cd, struct domain *d) { int rc; - bool preempted; + bool preempted = false; unsigned long mb = hap_get_allocation(d); if ( mb == hap_get_allocation(cd) )