[xen master] fix uninitialized variable error in do_poll()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] fix uninitialized variable error in do_poll()

patchbot
commit 34af96ed586fa4594453fabccbd87a5eb686ff16
Author:     Jan Beulich <[hidden email]>
AuthorDate: Fri Oct 5 16:24:56 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Fri Oct 5 16:24:56 2018 +0200

    fix uninitialized variable error in do_poll()
   
    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 <[hidden email]>
    Acked-by: Wei Liu <[hidden email]>
---
 xen/common/schedule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index f426fd8202..a957c5e57c 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog