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: 3fb4bc717b ("vhost: move app fini to the vhost subsystem")
Change-Id: I70f886f6792ffc5c499a8d8cb0b6ab01855f7e9b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/399129
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2018-02-09 13:35:33 +01:00 committed by Daniel Verkamp
parent 26731440ee
commit 33285599ef

View File

@ -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 *