From b8a618db14f7f12b8ace89bd2be30fa9ab607234 Mon Sep 17 00:00:00 2001 From: paul luse Date: Fri, 31 Jan 2020 20:45:23 +0000 Subject: [PATCH] module/crypto: use the correct error code for rpc decode failure Signed-off-by: paul luse Change-Id: Iabea7dfeaae7a57c8cbc2781882ee9e1600058a2 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/483527 Community-CI: SPDK CI Jenkins Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Alexey Marchuk --- module/bdev/crypto/vbdev_crypto_rpc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/module/bdev/crypto/vbdev_crypto_rpc.c b/module/bdev/crypto/vbdev_crypto_rpc.c index 10147527c..e0d428188 100644 --- a/module/bdev/crypto/vbdev_crypto_rpc.c +++ b/module/bdev/crypto/vbdev_crypto_rpc.c @@ -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; }