summaryrefslogtreecommitdiffstats
path: root/crypto/scatterwalk.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-05-19 06:06:29 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2010-05-19 06:06:29 +0200
commit85c6201a80ce4464a52c58a5f5ea8de15a557a6f (patch)
tree16a0ef528745a1d8404faadac2d7a5eeaf4b95a1 /crypto/scatterwalk.c
parentcrypto: hifn_795x - Rename ablkcipher_walk to hifn_cipher_walk (diff)
downloadlinux-85c6201a80ce4464a52c58a5f5ea8de15a557a6f.tar.xz
linux-85c6201a80ce4464a52c58a5f5ea8de15a557a6f.zip
crypto: scatterwalk - Fix scatterwalk_done() test
We are done with the scattergather entry when the walk offset goes past sg->offset + sg->length, not when it crosses a page boundary. There is a similarly queer test in the second half of scatterwalk_pagedone() that probably needs some scrutiny. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/scatterwalk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index 3de89a424401..41e529af0773 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -68,7 +68,7 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
void scatterwalk_done(struct scatter_walk *walk, int out, int more)
{
- if (!offset_in_page(walk->offset) || !more)
+ if (!(scatterwalk_pagelen(walk) & (PAGE_SIZE - 1)) || !more)
scatterwalk_pagedone(walk, out, more);
}
EXPORT_SYMBOL_GPL(scatterwalk_done);