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: 41548c5472 ("mem_sharing: VM forking")
Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Tamas K Lengyel authored and Andrew Cooper committed 2021-01-18 17:50:11 +00:00
1 parent 1839011c7e
commit cb34a2fa16
1 file changed
+1 -1
+1 -1
View File
@@ -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) )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.