Commit 33285599 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Daniel Verkamp
Browse files

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: 3fb4bc71 ("vhost: move app fini to the vhost subsystem")
Change-Id: I70f886f6792ffc5c499a8d8cb0b6ab01855f7e9b
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/399129


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 26731440
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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 *