summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe.montjoie@gmail.com>2025-04-27 13:12:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-27 11:05:10 +0100
commitada335e8475d9ee0c663df9fc1740f203d821eb1 (patch)
tree0b07f376cc309939db9dffa23f2cb6314eafc474 /drivers/crypto
parentfb2671376bbfa22505caf86b4400ce1cc234156c (diff)
downloadlinux-ada335e8475d9ee0c663df9fc1740f203d821eb1.tar.gz
linux-ada335e8475d9ee0c663df9fc1740f203d821eb1.tar.bz2
linux-ada335e8475d9ee0c663df9fc1740f203d821eb1.zip
crypto: sun8i-ss - do not use sg_dma_len before calling DMA functions
[ Upstream commit 2dfc7cd74a5e062a5405560447517e7aab1c7341 ] When testing sun8i-ss with multi_v7_defconfig, all CBC algorithm fail crypto selftests. This is strange since on sunxi_defconfig, everything was ok. The problem was in the IV setup loop which never run because sg_dma_len was 0. Fixes: 359e893e8af4 ("crypto: sun8i-ss - rework handling of IV") Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c2
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 0cc8cafdde27..3bf56ac1132f 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
@@ -117,7 +117,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq)
/* we need to copy all IVs from source in case DMA is bi-directionnal */
while (sg && len) {
- if (sg_dma_len(sg) == 0) {
+ if (sg->length == 0) {
sg = sg_next(sg);
continue;
}