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

[Xen-changelog] [xen-unstable] mini-os: Fix crash on frontend shutdown failures



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1270624575 -3600
# Node ID d7ee309d0e0137c051b464b445f75e5059b181d0
# Parent  3895f8e0e63310e76a80e88ae31ccee2053ab8f2
mini-os: Fix crash on frontend shutdown failures

Do not free frontend resources if some error happened, since the
backend may not have finished properly restarting in such case.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 extras/mini-os/blkfront.c |    3 ++-
 extras/mini-os/fbfront.c  |    6 ++++--
 extras/mini-os/netfront.c |    3 ++-
 extras/mini-os/pcifront.c |    3 ++-
 4 files changed, 10 insertions(+), 5 deletions(-)

diff -r 3895f8e0e633 -r d7ee309d0e01 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Wed Apr 07 08:15:55 2010 +0100
+++ b/extras/mini-os/blkfront.c Wed Apr 07 08:16:15 2010 +0100
@@ -313,7 +313,8 @@ close:
     snprintf(path, sizeof(path), "%s/event-channel", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_blkfront(dev);
+    if (!err)
+        free_blkfront(dev);
 }
 
 static void blkfront_wait_slot(struct blkfront_dev *dev)
diff -r 3895f8e0e633 -r d7ee309d0e01 extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c  Wed Apr 07 08:15:55 2010 +0100
+++ b/extras/mini-os/fbfront.c  Wed Apr 07 08:16:15 2010 +0100
@@ -288,7 +288,8 @@ close_kbdfront:
     snprintf(path, sizeof(path), "%s/request-abs-pointer", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_kbdfront(dev);
+    if (!err)
+        free_kbdfront(dev);
 }
 
 #ifdef HAVE_LIBC
@@ -681,7 +682,8 @@ close_fbfront:
     snprintf(path, sizeof(path), "%s/feature-update", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_fbfront(dev);
+    if (!err)
+        free_fbfront(dev);
 }
 
 #ifdef HAVE_LIBC
diff -r 3895f8e0e633 -r d7ee309d0e01 extras/mini-os/netfront.c
--- a/extras/mini-os/netfront.c Wed Apr 07 08:15:55 2010 +0100
+++ b/extras/mini-os/netfront.c Wed Apr 07 08:16:15 2010 +0100
@@ -574,7 +574,8 @@ close:
     snprintf(path, sizeof(path), "%s/request-rx-copy", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_netfront(dev);
+    if (!err)
+        free_netfront(dev);
 }
 
 
diff -r 3895f8e0e633 -r d7ee309d0e01 extras/mini-os/pcifront.c
--- a/extras/mini-os/pcifront.c Wed Apr 07 08:15:55 2010 +0100
+++ b/extras/mini-os/pcifront.c Wed Apr 07 08:16:15 2010 +0100
@@ -378,7 +378,8 @@ close_pcifront:
     snprintf(path, sizeof(path), "%s/event-channel", nodename);
     xenbus_rm(XBT_NIL, path);
 
-    free_pcifront(dev);
+    if (!err)
+        free_pcifront(dev);
 }
 
 int pcifront_physical_to_virtual (struct pcifront_dev *dev,

_______________________________________________
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®.