rpc: fix segfault on get_spdk_version request with extra params

We tried to send two responses for a single RPC request.

Fixes #798

Change-Id: I37eebd6a1212f6ab2c026b7587415e42c3c7417e
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455220
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Darek Stojaczyk 2019-05-21 11:48:14 +02:00
parent e036215fe9
commit 75a6265de9

View File

@ -391,6 +391,7 @@ spdk_rpc_get_spdk_version(struct spdk_jsonrpc_request *request, const struct spd
if (params != NULL) {
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
"get_spdk_version method requires no parameters");
return;
}
w = spdk_jsonrpc_begin_result(request);