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@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
8c7c3c58e3
commit
773de5c786
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user