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] test return value of kmalloc to prevent crash is the all

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] test return value of kmalloc to prevent crash is the allocation fail.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 07 Jan 2006 16:54:09 +0000
Delivery-date: Sat, 07 Jan 2006 17:00: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 e93340cf4d02e3d4d3166769617981b8d9892432
# Parent  a933d82321b3c638879e725a911bf52ed5413eec
test return value of kmalloc to prevent crash is the allocation fail.

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

diff -r a933d82321b3 -r e93340cf4d02 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Fri Jan  6 
22:03:58 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Fri Jan  6 
22:07:04 2006
@@ -140,6 +140,8 @@
 
                if (u->u.msg.type == XS_TRANSACTION_START) {
                        trans = kmalloc(sizeof(*trans), GFP_KERNEL);
+                       if (!trans)
+                               return -ENOMEM;
                        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] test return value of kmalloc to prevent crash is the allocation fail., Xen patchbot -unstable <=