Commit ec79b4c8 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

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: default avatarDarek 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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 44ad025a
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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_poller_unregister(&poller_ctx->init_poller);
		free(poller_ctx);
	}