mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
crypto: inside-secure - fix use of the SG list
Replace sg_nents_for_len by sg_nents when DMA mapping/unmapping buffers and when looping over the SG entries. This fix cases where the SG entries aren't used fully, which would in such cases led to using fewer SG entries than needed (and thus the engine wouldn't have access to the full input data and the result would be wrong). Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
082ec2d484
commit
583d7e195f
@@ -273,8 +273,7 @@ static int safexcel_ahash_send_req(struct crypto_async_request *async, int ring,
|
||||
}
|
||||
|
||||
/* Now handle the current ahash request buffer(s) */
|
||||
req->nents = dma_map_sg(priv->dev, areq->src,
|
||||
sg_nents_for_len(areq->src, areq->nbytes),
|
||||
req->nents = dma_map_sg(priv->dev, areq->src, sg_nents(areq->src),
|
||||
DMA_TO_DEVICE);
|
||||
if (!req->nents) {
|
||||
ret = -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user