From 15d5739ea96c83a989c31e5f28436004cf831035 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 7 Apr 2010 08:16:15 +0100 Subject: 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 --- extras/mini-os/pcifront.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'extras/mini-os/pcifront.c') diff --git a/extras/mini-os/pcifront.c b/extras/mini-os/pcifront.c index 638fdb3966..dc6c461de8 100644 --- a/extras/mini-os/pcifront.c +++ b/extras/mini-os/pcifront.c @@ -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, -- cgit v1.2.3