crypto: hisilicon - Fix issue with wrong number of sg elements after dma map
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Nov 2019 05:42:56 +0000 (13:42 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Dec 2019 08:34:44 +0000 (16:34 +0800)
commit8debacd60c69beab80736d4af4feca47c2e2bd9e
tree02ea8a9abab64a8f3abda061afc521a55b988456
parent07928d9bfc81640bab36f5190e8725894d93b659
crypto: hisilicon - Fix issue with wrong number of sg elements after dma map

We fill the hardware scatter gather list assuming it will need the same
number of elements at the original scatterlist. If an IOMMU is involved,
then it may well need fewer. The return value of dma_map_sg tells us how
many.

Probably never caused visible problems as the hardware won't get to
the elements that are incorrect before it finds enough space.

Fixes: dfed0098ab91 (crypto: hisilicon - add hardware SGL support)
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/sgl.c