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/blkfront.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'extras/mini-os/blkfront.c') diff --git a/extras/mini-os/blkfront.c b/extras/mini-os/blkfront.c index f47aa69f23..d59140fcb8 100644 --- a/extras/mini-os/blkfront.c +++ b/extras/mini-os/blkfront.c @@ -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) -- cgit v1.2.3