From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbqLG-0000DX-FU for qemu-devel@nongnu.org; Fri, 23 Nov 2012 05:18:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbqLC-0006gZ-29 for qemu-devel@nongnu.org; Fri, 23 Nov 2012 05:18:38 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:38463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbqLB-0006gO-Pi for qemu-devel@nongnu.org; Fri, 23 Nov 2012 05:18:33 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 23 Nov 2012 10:18:30 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qANAIL7m63111168 for ; Fri, 23 Nov 2012 10:18:21 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qANAISme005011 for ; Fri, 23 Nov 2012 03:18:28 -0700 From: Jens Freimann Date: Fri, 23 Nov 2012 11:18:12 +0100 Message-Id: <1353665892-35445-4-git-send-email-jfrei@linux.vnet.ibm.com> In-Reply-To: <1353665892-35445-1-git-send-email-jfrei@linux.vnet.ibm.com> References: <1353665892-35445-1-git-send-email-jfrei@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 3/3] sclp: Fix uninitialized var in handle_write_event_buf(). List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Heinz Graalfs , qemu-devel , Viktor Mihajlovski , Christian Borntraeger , Jens Freimann , Cornelia Huck , Einar Lueck From: Cornelia Huck 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 Signed-off-by: Christian Borntraeger Signed-off-by: Jens Freimann --- hw/s390x/event-facility.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 1.7.12.4