module/crypto: use the correct error code for rpc decode failure

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Iabea7dfeaae7a57c8cbc2781882ee9e1600058a2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/483527
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
paul luse 2020-01-31 20:45:23 +00:00 committed by Tomasz Zawadzki
parent 17f7cf9b29
commit b8a618db14

View File

@ -73,9 +73,8 @@ spdk_rpc_bdev_crypto_create(struct spdk_jsonrpc_request *request,
if (spdk_json_decode_object(params, rpc_construct_crypto_decoders,
SPDK_COUNTOF(rpc_construct_crypto_decoders),
&req)) {
SPDK_DEBUGLOG(SPDK_LOG_CRYPTO, "spdk_json_decode_object failed\n");
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
"spdk_json_decode_object failed");
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
"Invalid parameters");
goto cleanup;
}
@ -132,8 +131,8 @@ spdk_rpc_bdev_crypto_delete(struct spdk_jsonrpc_request *request,
if (spdk_json_decode_object(params, rpc_delete_crypto_decoders,
SPDK_COUNTOF(rpc_delete_crypto_decoders),
&req)) {
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
"spdk_json_decode_object failed");
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
"Invalid parameters");
goto cleanup;
}