x86/vpt: fix build with old gcc
authorJan Beulich <jbeulich@suse.com>
Wed, 18 Nov 2020 11:38:01 +0000 (12:38 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Nov 2020 11:38:01 +0000 (12:38 +0100)
I believe it was the XSA-336 fix (42fcdd42328f "x86/vpt: fix race when
migrating timers between vCPUs") which has unmasked a bogus
uninitialized variable warning. This is observable with gcc 4.3.4, but
only on 4.13 and older; it's hidden on newer versions apparently due to
the addition to _read_unlock() done by 12509bbeb9e3 ("rwlocks: call
preempt_disable() when taking a rwlock").

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/vpt.c

index 867deb4da5dd21fdbf462bbf645c6c5275e29534..4c2afe2e9154ba66af62f6d574d03e422236016b 100644 (file)
@@ -401,7 +401,7 @@ int pt_update_irq(struct vcpu *v)
                  * associated with the timer.
                  */
                 time_cb *cb = NULL;
-                void *cb_priv;
+                void *cb_priv = NULL;
 
                 pt_vcpu_lock(v);
                 /* Make sure the timer is still on the list. */