From 4044f8b62e5a3a4644298bfc6b586a11a1fa540a Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Thu, 23 Feb 2017 14:09:24 -0700 Subject: [PATCH] rpc: Remove event from module unload path By the time the module is unloaded, the reactors have already stopped. That means the event will never actually fire. Simply remove it. Change-Id: I4fe371ae7a679d51254d0267fbbbf74c3e9cf477 Signed-off-by: Ben Walker --- lib/rpc/rpc.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/rpc/rpc.c b/lib/rpc/rpc.c index 61f5a7b18c..5604f795f5 100644 --- a/lib/rpc/rpc.c +++ b/lib/rpc/rpc.c @@ -261,27 +261,20 @@ spdk_rpc_initialize(void) return 0; } -static void -spdk_rpc_finish_cleanup(void *arg1, void *arg2) -{ - if (g_jsonrpc_server) { - spdk_jsonrpc_server_shutdown(g_jsonrpc_server); - } -} - static int spdk_rpc_finish(void) { - struct spdk_event *complete; - if (g_rpc_listen_addr_unix.sun_path[0]) { /* Delete the Unix socket file */ unlink(g_rpc_listen_addr_unix.sun_path); } - complete = spdk_event_allocate(spdk_app_get_current_core(), spdk_rpc_finish_cleanup, - NULL, NULL); - spdk_poller_unregister(&g_rpc_poller, complete); + spdk_poller_unregister(&g_rpc_poller, NULL); + + if (g_jsonrpc_server) { + spdk_jsonrpc_server_shutdown(g_jsonrpc_server); + } + return 0; }