From c79a52c5470ada323f3fabcc88d8dd8dc1300658 Mon Sep 17 00:00:00 2001 From: Wenkai Lin Date: Thu, 10 Mar 2022 20:03:14 +0800 Subject: [PATCH 095/109] uadk: cipher: fix wd_cipher_check_params no need to set ret and optimize the return line. Signed-off-by: Wenkai Lin --- wd_cipher.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wd_cipher.c b/wd_cipher.c index afd8c4d..88d3b04 100644 --- a/wd_cipher.c +++ b/wd_cipher.c @@ -384,7 +384,7 @@ static int wd_cipher_check_params(handle_t h_sess, struct wd_cipher_req *req, __u8 mode) { struct wd_cipher_sess *sess = (struct wd_cipher_sess *)h_sess; - int ret = 0; + int ret; if (unlikely(!h_sess || !req)) { WD_ERR("cipher input sess or req is NULL!\n"); @@ -419,11 +419,7 @@ static int wd_cipher_check_params(handle_t h_sess, } } - ret = cipher_iv_len_check(req, sess); - if (unlikely(ret)) - return ret; - - return 0; + return cipher_iv_len_check(req, sess); } static int send_recv_sync(struct wd_ctx_internal *ctx, -- 2.27.0