mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-20 17:34:34 +07:00
xen: unitialised return value in xenbus_write_transaction
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>
This commit is contained in:
parent
659d2618b3
commit
e88a0faae5
@ -291,7 +291,7 @@ static void watch_fired(struct xenbus_watch *watch,
|
|||||||
static int xenbus_write_transaction(unsigned msg_type,
|
static int xenbus_write_transaction(unsigned msg_type,
|
||||||
struct xenbus_file_priv *u)
|
struct xenbus_file_priv *u)
|
||||||
{
|
{
|
||||||
int rc, ret;
|
int rc;
|
||||||
void *reply;
|
void *reply;
|
||||||
struct xenbus_transaction_holder *trans = NULL;
|
struct xenbus_transaction_holder *trans = NULL;
|
||||||
LIST_HEAD(staging_q);
|
LIST_HEAD(staging_q);
|
||||||
@ -326,15 +326,14 @@ static int xenbus_write_transaction(unsigned msg_type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&u->reply_mutex);
|
mutex_lock(&u->reply_mutex);
|
||||||
ret = queue_reply(&staging_q, &u->u.msg, sizeof(u->u.msg));
|
rc = queue_reply(&staging_q, &u->u.msg, sizeof(u->u.msg));
|
||||||
if (!ret)
|
if (!rc)
|
||||||
ret = queue_reply(&staging_q, reply, u->u.msg.len);
|
rc = queue_reply(&staging_q, reply, u->u.msg.len);
|
||||||
if (!ret) {
|
if (!rc) {
|
||||||
list_splice_tail(&staging_q, &u->read_buffers);
|
list_splice_tail(&staging_q, &u->read_buffers);
|
||||||
wake_up(&u->read_waitq);
|
wake_up(&u->read_waitq);
|
||||||
} else {
|
} else {
|
||||||
queue_cleanup(&staging_q);
|
queue_cleanup(&staging_q);
|
||||||
rc = ret;
|
|
||||||
}
|
}
|
||||||
mutex_unlock(&u->reply_mutex);
|
mutex_unlock(&u->reply_mutex);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user