diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-04-17 22:25:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-17 11:53:40 +0200 |
commit | 1055eddce77681e590d751f17027305d97cb670d (patch) | |
tree | 77733cceab130ee5a51d32b6c446fdb2af49d79e | |
parent | 267db6bff34b47d0762358a18315660e26efbe5c (diff) | |
download | linux-stable-1055eddce77681e590d751f17027305d97cb670d.tar.gz linux-stable-1055eddce77681e590d751f17027305d97cb670d.tar.bz2 linux-stable-1055eddce77681e590d751f17027305d97cb670d.zip |
crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
[ Upstream commit 8fd91151ebcb21b3f2f2bf158ac6092192550b2b ]
SS_ENCRYPTION is (0 << 7 = 0), so the test can never be true.
Use a direct comparison to SS_ENCRYPTION instead.
The same king of test is already done the same way in sun8i_ss_run_task().
Fixes: 359e893e8af4 ("crypto: sun8i-ss - rework handling of IV")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c index 902f6be057ec..e97fb203690a 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c @@ -151,7 +151,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq) } rctx->p_iv[i] = a; /* we need to setup all others IVs only in the decrypt way */ - if (rctx->op_dir & SS_ENCRYPTION) + if (rctx->op_dir == SS_ENCRYPTION) return 0; todo = min(len, sg_dma_len(sg)); len -= todo; |