]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: sun8i-ce - fix nents passed to dma_unmap_sg()
authorOvidiu Panait <ovidiu.panait.oss@gmail.com>
Mon, 19 May 2025 15:13:48 +0000 (18:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:08:51 +0000 (12:08 +0200)
commit25c161a8bed137882d66c317c7b8d3a3001e39e8
tree24895a26ac99b28630a601d098dcd9140bb9f97d
parent0c93cd98d0c8578aa48bf4b747040a475179a497
crypto: sun8i-ce - fix nents passed to dma_unmap_sg()

[ Upstream commit b6cd3cfb5afe49952f8f6be947aeeca9ba0faebb ]

In sun8i_ce_cipher_unprepare(), dma_unmap_sg() is incorrectly called with
the number of entries returned by dma_map_sg(), rather than using the
original number of entries passed when mapping the scatterlist.

To fix this, stash the original number of entries passed to dma_map_sg()
in the request context.

Fixes: 0605fa0f7826 ("crypto: sun8i-ce - split into prepare/run/unprepare")
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
Acked-by: Corentin LABBE <clabbe.montjoie@gmail.com>
Tested-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>
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c