libwd/0087-uadk-cipher-fix-wd_cipher_check_params.patch
Wenkai Lin d2ed8a299c libwd backport for uadk from 2.3.29 to 2.3.31
Update some patch for uadk from mainline.
To get more infomation, please visit the homepage:
https://github.com/Linaro/uadk

Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
2022-03-22 11:52:29 +08:00

42 lines
1.1 KiB
Diff

From c79a52c5470ada323f3fabcc88d8dd8dc1300658 Mon Sep 17 00:00:00 2001
From: Wenkai Lin <linwenkai6@hisilicon.com>
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 <linwenkai6@hisilicon.com>
---
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