]> www.infradead.org Git - users/dwmw2/linux.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:37:01 +0000 (04:37 -0800)
commitec650dd304b6abf476195ca2e47d1d376a53270e
tree7097e34d3c9071fba0b6bd037be6bf92858ebeed
parentc0601cad84b5d11a22354600edd711c6e13df686
crypto: hisilicon - Fix issue with wrong number of sg elements after dma map

commit 8debacd60c69beab80736d4af4feca47c2e2bd9e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/hisilicon/sgl.c