app: fixup error handling in wait_subsystem_init RPC

We could call spdk_jsonrpc_end_result with a NULL
result parameter, which will hit an assert.

While here, also remove the "no memory" error message
if the result object can't be obtained. Getting no result
is not necessarily caused by memory allocation failure
and everywhere throughout the SPDK we don't print any
message if that happens.

Change-Id: I4618b211192aa1c1d47fd850d17497d3ff9888ea
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/435112
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Darek Stojaczyk 2018-11-27 11:30:04 +01:00 committed by Jim Harris
parent 44ad025aaa
commit ec79b4c8e4

View File

@ -1035,12 +1035,10 @@ spdk_rpc_subsystem_init_poller_ctx(void *ctx)
if (spdk_rpc_get_state() == SPDK_RPC_RUNTIME) {
w = spdk_jsonrpc_begin_result(poller_ctx->request);
if (w == NULL) {
SPDK_ERRLOG("Unable to allocate memory for RPC response\n");
} else {
if (w != NULL) {
spdk_json_write_bool(w, true);
spdk_jsonrpc_end_result(poller_ctx->request, w);
}
spdk_jsonrpc_end_result(poller_ctx->request, w);
spdk_poller_unregister(&poller_ctx->init_poller);
free(poller_ctx);
}