Skip to content

Commit

Permalink
xenbus: remove transaction holder from list before freeing
Browse files Browse the repository at this point in the history
After allocation the item is being placed on the list right away.
Consequently it needs to be taken off the list before freeing in the
case xenbus_dev_request_and_reply() failed, as in that case the
callback (xenbus_dev_queue_reply()) is not being called (and if it
was called, it should do both).

Fixes: 5584ea2
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
  • Loading branch information
Jan Beulich authored and Boris Ostrovsky committed Apr 4, 2017
1 parent 1914f0c commit ac4cde3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/xen/xenbus/xenbus_dev_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@ static int xenbus_write_transaction(unsigned msg_type,
return xenbus_command_reply(u, XS_ERROR, "ENOENT");

rc = xenbus_dev_request_and_reply(&u->u.msg, u);
if (rc)
if (rc && trans) {
list_del(&trans->list);
kfree(trans);
}

out:
return rc;
Expand Down

0 comments on commit ac4cde3

Please sign in to comment.