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/fbfront.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'extras/mini-os/fbfront.c') diff --git a/extras/mini-os/fbfront.c b/extras/mini-os/fbfront.c index 6d2268e27e..ef024cbcd0 100644 --- a/extras/mini-os/fbfront.c +++ b/extras/mini-os/fbfront.c @@ -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 -- cgit v1.2.3