summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarina Yankevich <k.yankevich@omp.ru>2025-11-05 17:52:04 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2025-11-14 18:15:48 +0800
commitd52e9b8843749f446dff2afcfc5da3d8bbe806cc (patch)
tree24a8e83363262a894601bcf12b24b6c948fd2511
parentd633730bb3873578a00fde4b97f9ac62a1be8d34 (diff)
crypto: rockchip - drop redundant crypto_skcipher_ivsize() calls
The function already initialized the ivsize variable at the point of declaration, let's use it instead of calling crypto_skcipher_ivsize() extra couple times. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 57d67c6e8219 ("crypto: rockchip - rework by using crypto_engine") Signed-off-by: Karina Yankevich <k.yankevich@omp.ru> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/rockchip/rk3288_crypto_skcipher.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/rockchip/rk3288_crypto_skcipher.c b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
index 9393e10671c2..e80f9148c012 100644
--- a/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
+++ b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
@@ -321,8 +321,7 @@ static int rk_cipher_run(struct crypto_engine *engine, void *async_req)
algt->stat_req++;
rkc->nreq++;
- ivsize = crypto_skcipher_ivsize(tfm);
- if (areq->iv && crypto_skcipher_ivsize(tfm) > 0) {
+ if (areq->iv && ivsize > 0) {
if (rctx->mode & RK_CRYPTO_DEC) {
offset = areq->cryptlen - ivsize;
scatterwalk_map_and_copy(rctx->backup_iv, areq->src,