[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] free trans if allocated, if dev_request_and_reply fail.



# HG changeset patch
# User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID fbf58585008a9a8d4bec2d47ac64166c77d5bf7f
# Parent  96c7303b03ab570bff9df5944ca9ea35b63fdaf6
free trans if allocated, if dev_request_and_reply fail.

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>

diff -r 96c7303b03ab -r fbf58585008a 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Mon Jan  9 
11:31:49 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Mon Jan  9 
13:11:55 2006
@@ -109,7 +109,7 @@
                                size_t len, loff_t *ppos)
 {
        struct xenbus_dev_data *u = filp->private_data;
-       struct xenbus_dev_transaction *trans;
+       struct xenbus_dev_transaction *trans = NULL;
        void *reply;
 
        if ((len + u->len) > sizeof(u->u.buffer))
@@ -141,8 +141,10 @@
                }
 
                reply = xenbus_dev_request_and_reply(&u->u.msg);
-               if (IS_ERR(reply))
+               if (IS_ERR(reply)) {
+                       kfree(trans);
                        return PTR_ERR(reply);
+               }
 
                if (u->u.msg.type == XS_TRANSACTION_START) {
                        trans->handle = (struct xenbus_transaction *)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.