WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fail early without calling dev_request_and_reply if memo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fail early without calling dev_request_and_reply if memory cannot be allocated.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 09 Jan 2006 14:06:07 +0000
Delivery-date: Mon, 09 Jan 2006 14:12:29 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 96c7303b03ab570bff9df5944ca9ea35b63fdaf6
# Parent  0ba3b9d60da65bcb9a14122c8b17c255354db764
Fail early without calling dev_request_and_reply if memory cannot be allocated.

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

diff -r 0ba3b9d60da6 -r 96c7303b03ab 
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:25:05 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Mon Jan  9 
11:31:49 2006
@@ -134,14 +134,17 @@
        case XS_MKDIR:
        case XS_RM:
        case XS_SET_PERMS:
-               reply = xenbus_dev_request_and_reply(&u->u.msg);
-               if (IS_ERR(reply))
-                       return PTR_ERR(reply);
-
                if (u->u.msg.type == XS_TRANSACTION_START) {
                        trans = kmalloc(sizeof(*trans), GFP_KERNEL);
                        if (!trans)
                                return -ENOMEM;
+               }
+
+               reply = xenbus_dev_request_and_reply(&u->u.msg);
+               if (IS_ERR(reply))
+                       return PTR_ERR(reply);
+
+               if (u->u.msg.type == XS_TRANSACTION_START) {
                        trans->handle = (struct xenbus_transaction *)
                                simple_strtoul(reply, NULL, 0);
                        list_add(&trans->list, &u->transactions);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fail early without calling dev_request_and_reply if memory cannot be allocated., Xen patchbot -unstable <=