Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: sun8i-ss - do not use sg_dma_len before calling DMA functions

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>

authored by

Corentin Labbe and committed by
Herbert Xu
2dfc7cd7 0f8d42bf

+1 -1
+1 -1
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c
··· 141 141 142 142 /* we need to copy all IVs from source in case DMA is bi-directionnal */ 143 143 while (sg && len) { 144 - if (sg_dma_len(sg) == 0) { 144 + if (sg->length == 0) { 145 145 sg = sg_next(sg); 146 146 continue; 147 147 }