diff --git a/lib/event/app.c b/lib/event/app.c index e04c6f188..ac05626c2 100644 --- a/lib/event/app.c +++ b/lib/event/app.c @@ -578,7 +578,7 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_msg_fn start_fn, struct spdk_conf *config = NULL; int rc; char *tty; - struct spdk_cpuset *tmp_cpumask; + struct spdk_cpuset tmp_cpumask = {}; if (!opts) { SPDK_ERRLOG("opts should not be NULL\n"); @@ -651,19 +651,11 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_msg_fn start_fn, return 1; } - tmp_cpumask = spdk_cpuset_alloc(); - if (tmp_cpumask == NULL) { - SPDK_ERRLOG("spdk_cpuset_alloc() failed\n"); - return 1; - } - - spdk_cpuset_zero(tmp_cpumask); - spdk_cpuset_set_cpu(tmp_cpumask, spdk_env_get_current_core(), true); + spdk_cpuset_set_cpu(&tmp_cpumask, spdk_env_get_current_core(), true); /* Now that the reactors have been initialized, we can create an * initialization thread. */ - g_app_thread = spdk_thread_create("app_thread", tmp_cpumask); - spdk_cpuset_free(tmp_cpumask); + g_app_thread = spdk_thread_create("app_thread", &tmp_cpumask); if (!g_app_thread) { SPDK_ERRLOG("Unable to create an spdk_thread for initialization\n"); return 1;