debuggers.hg

changeset 21160:d7ee309d0e01

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@ens-lyon.org>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 07 08:16:15 2010 +0100 (2010-04-07)
parents 3895f8e0e633
children 6c833a9ee3c4
files extras/mini-os/blkfront.c extras/mini-os/fbfront.c extras/mini-os/netfront.c extras/mini-os/pcifront.c
line diff
     1.1 --- a/extras/mini-os/blkfront.c	Wed Apr 07 08:15:55 2010 +0100
     1.2 +++ b/extras/mini-os/blkfront.c	Wed Apr 07 08:16:15 2010 +0100
     1.3 @@ -313,7 +313,8 @@ close:
     1.4      snprintf(path, sizeof(path), "%s/event-channel", nodename);
     1.5      xenbus_rm(XBT_NIL, path);
     1.6  
     1.7 -    free_blkfront(dev);
     1.8 +    if (!err)
     1.9 +        free_blkfront(dev);
    1.10  }
    1.11  
    1.12  static void blkfront_wait_slot(struct blkfront_dev *dev)
     2.1 --- a/extras/mini-os/fbfront.c	Wed Apr 07 08:15:55 2010 +0100
     2.2 +++ b/extras/mini-os/fbfront.c	Wed Apr 07 08:16:15 2010 +0100
     2.3 @@ -288,7 +288,8 @@ close_kbdfront:
     2.4      snprintf(path, sizeof(path), "%s/request-abs-pointer", nodename);
     2.5      xenbus_rm(XBT_NIL, path);
     2.6  
     2.7 -    free_kbdfront(dev);
     2.8 +    if (!err)
     2.9 +        free_kbdfront(dev);
    2.10  }
    2.11  
    2.12  #ifdef HAVE_LIBC
    2.13 @@ -681,7 +682,8 @@ close_fbfront:
    2.14      snprintf(path, sizeof(path), "%s/feature-update", nodename);
    2.15      xenbus_rm(XBT_NIL, path);
    2.16  
    2.17 -    free_fbfront(dev);
    2.18 +    if (!err)
    2.19 +        free_fbfront(dev);
    2.20  }
    2.21  
    2.22  #ifdef HAVE_LIBC
     3.1 --- a/extras/mini-os/netfront.c	Wed Apr 07 08:15:55 2010 +0100
     3.2 +++ b/extras/mini-os/netfront.c	Wed Apr 07 08:16:15 2010 +0100
     3.3 @@ -574,7 +574,8 @@ close:
     3.4      snprintf(path, sizeof(path), "%s/request-rx-copy", nodename);
     3.5      xenbus_rm(XBT_NIL, path);
     3.6  
     3.7 -    free_netfront(dev);
     3.8 +    if (!err)
     3.9 +        free_netfront(dev);
    3.10  }
    3.11  
    3.12  
     4.1 --- a/extras/mini-os/pcifront.c	Wed Apr 07 08:15:55 2010 +0100
     4.2 +++ b/extras/mini-os/pcifront.c	Wed Apr 07 08:16:15 2010 +0100
     4.3 @@ -378,7 +378,8 @@ close_pcifront:
     4.4      snprintf(path, sizeof(path), "%s/event-channel", nodename);
     4.5      xenbus_rm(XBT_NIL, path);
     4.6  
     4.7 -    free_pcifront(dev);
     4.8 +    if (!err)
     4.9 +        free_pcifront(dev);
    4.10  }
    4.11  
    4.12  int pcifront_physical_to_virtual (struct pcifront_dev *dev,