Commit b8a618db authored by paul luse's avatar paul luse Committed by Tomasz Zawadzki
Browse files

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



Signed-off-by: default avatarpaul 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
parent 17f7cf9b
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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;
	}