The return value of xenbus_write_transaction can be uninitialised in
the success case leading to the userspace xenstore utilities failing.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
static int xenbus_write_transaction(unsigned msg_type,
struct xenbus_file_priv *u)
{
static int xenbus_write_transaction(unsigned msg_type,
struct xenbus_file_priv *u)
{
void *reply;
struct xenbus_transaction_holder *trans = NULL;
LIST_HEAD(staging_q);
void *reply;
struct xenbus_transaction_holder *trans = NULL;
LIST_HEAD(staging_q);
}
mutex_lock(&u->reply_mutex);
}
mutex_lock(&u->reply_mutex);
- ret = queue_reply(&staging_q, &u->u.msg, sizeof(u->u.msg));
- if (!ret)
- ret = queue_reply(&staging_q, reply, u->u.msg.len);
- if (!ret) {
+ rc = queue_reply(&staging_q, &u->u.msg, sizeof(u->u.msg));
+ if (!rc)
+ rc = queue_reply(&staging_q, reply, u->u.msg.len);
+ if (!rc) {
list_splice_tail(&staging_q, &u->read_buffers);
wake_up(&u->read_waitq);
} else {
queue_cleanup(&staging_q);
list_splice_tail(&staging_q, &u->read_buffers);
wake_up(&u->read_waitq);
} else {
queue_cleanup(&staging_q);
}
mutex_unlock(&u->reply_mutex);
}
mutex_unlock(&u->reply_mutex);