From 33285599ef18dce2c0c29c843b9b2287b0eccd21 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Fri, 9 Feb 2018 13:35:33 +0100 Subject: [PATCH] vhost: fix double module fini on vhost init failure Doing a manual vhost module fini followed by an spdk_app_stop is wrong, as the app_stop will trigger the vhost module fini again. This will potentially free the g_num_ctrlrs twice. Doing just spdk_app_stop is enough. Fixes #238 Fixes: 3fb4bc717bbd ("vhost: move app fini to the vhost subsystem") Change-Id: I70f886f6792ffc5c499a8d8cb0b6ab01855f7e9b Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/399129 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Pawel Wodkowski Reviewed-by: Daniel Verkamp --- lib/vhost/vhost.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 5be222551..533286dae 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -1125,12 +1125,6 @@ out: return rc; } -static void -spdk_vhost_kill_cb(void) -{ - spdk_app_stop(0); -} - void spdk_vhost_startup(void *arg1, void *arg2) { @@ -1165,7 +1159,7 @@ spdk_vhost_startup(void *arg1, void *arg2) return; out: - spdk_vhost_fini(spdk_vhost_kill_cb); + spdk_app_stop(-1); } static void *