[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-upstream-unstable] sclp: Fix uninitialized var in handle_write_event_buf().



commit 773de5c786a6050bbf3b33c0e29d1bd519a40b4b
Author: Cornelia Huck <cornelia.huck@xxxxxxxxxx>
Date:   Fri Nov 23 00:18:12 2012 +0000

    sclp: Fix uninitialized var in handle_write_event_buf().
    
    Some gcc versions rightly complain about a possibly unitialized rc,
    so let's move setting it before the QTAILQ_FOREACH().
    
    Signed-off-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx>
    Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
    Signed-off-by: Jens Freimann <jfrei@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Alexander Graf <agraf@xxxxxxx>
---
 hw/s390x/event-facility.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 9367660..bc9cea9 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -112,12 +112,13 @@ static uint16_t handle_write_event_buf(SCLPEventFacility 
*ef,
     SCLPEvent *event;
     SCLPEventClass *ec;
 
+    rc = SCLP_RC_INVALID_FUNCTION;
+
     QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) {
         DeviceState *qdev = kid->child;
         event = (SCLPEvent *) qdev;
         ec = SCLP_EVENT_GET_CLASS(event);
 
-        rc = SCLP_RC_INVALID_FUNCTION;
         if (ec->write_event_data &&
             ec->event_type() == event_buf->type) {
             rc = ec->write_event_data(event, event_buf);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.