fix uninitialized variable error in do_poll()
authorJan Beulich <jbeulich@suse.com>
Fri, 5 Oct 2018 14:24:56 +0000 (16:24 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Oct 2018 14:24:56 +0000 (16:24 +0200)
Now that CONFIG_HVM can (and should) be turned off for the shim, gcc 8.2
apparently is no longer sure that "port" is indeed initialized at

    if ( sched_poll->nr_ports == 1 )
        v->poll_evtchn = port;

It doesn't look to be impossible for the compiler to prove it is not,
but we also can't rely on that to be the case. Add an initializer.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
xen/common/schedule.c

index f426fd8202a249fe3ca8abbcf2c02527be07395a..a957c5e57c9bf549bd70b7cc5b0493d93a132570 100644 (file)
@@ -1014,7 +1014,7 @@ static long do_poll(struct sched_poll *sched_poll)
 {
     struct vcpu   *v = current;
     struct domain *d = v->domain;
-    evtchn_port_t  port;
+    evtchn_port_t  port = 0;
     long           rc;
     unsigned int   i;