Thread (11 messages) 11 messages, 3 authors, 2021-03-04

Re: [PATCH 2/4] crypto: cavium - Fix the parameter of dma_unmap_sg()

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2021-03-04 00:07:34

On Tue, Feb 09, 2021 at 02:59:23PM +0800, chenxiang wrote:
quoted hunk ↗ jump to hunk
From: Xiang Chen <redacted>

For function dma_unmap_sg(), the <nents> parameter should be number of
elements in the scatterlist prior to the mapping, not after the mapping.
So fix this usage.

Signed-off-by: Xiang Chen <redacted>
---
 drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
index 53ef067..1263194 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
@@ -170,7 +170,7 @@ static int dma_map_inbufs(struct nitrox_softreq *sr,
 		sr->in.total_bytes += sg_dma_len(sg);
 
 	sr->in.sg = req->src;
-	sr->in.sgmap_cnt = nents;
+	sr->in.sgmap_cnt = sg_nents(req->src);
 	ret = create_sg_component(sr, &sr->in, sr->in.sgmap_cnt);
So you're changing the count passed to create_sg_component.  Are you
sure that's correct? Even if it is correct you should change your
patch description to document this change.

Thanks,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help