Skip to content

Commit d52e9b8

Browse files
Karina Yankevichherbertx
authored andcommitted
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: 57d67c6 ("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>
1 parent d633730 commit d52e9b8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/crypto/rockchip/rk3288_crypto_skcipher.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ static int rk_cipher_run(struct crypto_engine *engine, void *async_req)
321321
algt->stat_req++;
322322
rkc->nreq++;
323323

324-
ivsize = crypto_skcipher_ivsize(tfm);
325-
if (areq->iv && crypto_skcipher_ivsize(tfm) > 0) {
324+
if (areq->iv && ivsize > 0) {
326325
if (rctx->mode & RK_CRYPTO_DEC) {
327326
offset = areq->cryptlen - ivsize;
328327
scatterwalk_map_and_copy(rctx->backup_iv, areq->src,

0 commit comments

Comments
 (0)