]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: inside-secure - avoid unmapping DMA memory that was not mapped
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Tue, 26 Dec 2017 16:21:16 +0000 (17:21 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 5 Jan 2018 07:43:05 +0000 (18:43 +1100)
commitb250a4a9c625405bbc899d478627396277aa42b2
treedd21c039ce87dad8711b670fe456b27dd7daa224
parent6e26c0173e65a91bd857cd09858046e22b67c7c8
crypto: inside-secure - avoid unmapping DMA memory that was not mapped

This patch adds a parameter in the SafeXcel ahash request structure to
keep track of the number of SG entries mapped. This allows not to call
dma_unmap_sg() when dma_map_sg() wasn't called in the first place. This
also removes a warning when the debugging of the DMA-API is enabled in
the kernel configuration: "DMA-API: device driver tries to free DMA
memory it has not allocated".

Cc: stable@vger.kernel.org
Fixes: 4db5ddddd6e4 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver")
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_hash.c