mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-16 02:14:58 +00:00
crypto: omap - Avoid redundant copy when using truncated sg list
omap_crypto_cleanup() currently copies data from sg to orig if either copy flag is set. However OMAP_CRYPTO_SG_COPIED means that sg refers to the same pages as orig, truncated to len bytes. There is no need to copy in this case. Only copy data if the OMAP_CRYPTO_DATA_COPIED flag is set. Fixes: 74ed87e7e7f7 ("crypto: omap - add base support library for common ...") Signed-off-by: Ben Hutchings <ben.hutchings@mind.be> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
9491923e4a
commit
ffe3ee8bb6
@ -210,7 +210,7 @@ void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig,
|
||||
buf = sg_virt(sg);
|
||||
pages = get_order(len);
|
||||
|
||||
if (orig && (flags & OMAP_CRYPTO_COPY_MASK))
|
||||
if (orig && (flags & OMAP_CRYPTO_DATA_COPIED))
|
||||
omap_crypto_copy_data(sg, orig, offset, len);
|
||||
|
||||
if (flags & OMAP_CRYPTO_DATA_COPIED)
|
||||
|
Loading…
x
Reference in New Issue
Block a user