aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/xenbus/xenbus_dev_frontend.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
index 85534ea63555..9433e46518c8 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -326,10 +326,13 @@ static int xenbus_write_transaction(unsigned msg_type,
326 } 326 }
327 327
328 if (msg_type == XS_TRANSACTION_START) { 328 if (msg_type == XS_TRANSACTION_START) {
329 trans->handle.id = simple_strtoul(reply, NULL, 0); 329 if (u->u.msg.type == XS_ERROR)
330 330 kfree(trans);
331 list_add(&trans->list, &u->transactions); 331 else {
332 } else if (msg_type == XS_TRANSACTION_END) { 332 trans->handle.id = simple_strtoul(reply, NULL, 0);
333 list_add(&trans->list, &u->transactions);
334 }
335 } else if (u->u.msg.type == XS_TRANSACTION_END) {
333 list_for_each_entry(trans, &u->transactions, list) 336 list_for_each_entry(trans, &u->transactions, list)
334 if (trans->handle.id == u->u.msg.tx_id) 337 if (trans->handle.id == u->u.msg.tx_id)
335 break; 338 break;