summaryrefslogtreecommitdiffstats
path: root/crypto/scatterwalk.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-03-31 12:58:20 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2007-03-31 12:58:20 +1000
commit9f1167272890c210399e6b8a32d7cf7295713f5d (patch)
tree5ace2f4d76d186b63270a4253eb85e6c12c47e2e /crypto/scatterwalk.c
parent4ee531a3e661207d4b2174486b0f86017a3adb82 (diff)
downloadop-kernel-dev-9f1167272890c210399e6b8a32d7cf7295713f5d.zip
op-kernel-dev-9f1167272890c210399e6b8a32d7cf7295713f5d.tar.gz
[CRYPTO] api: Flush the current page right than the next
On platforms where flush_dcache_page is needed we're currently flushing the next page right than the one we've just processed. This patch fixes the off-by-one error. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/scatterwalk.c')
-rw-r--r--crypto/scatterwalk.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index 0f76175..81afd17 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -59,8 +59,12 @@ EXPORT_SYMBOL_GPL(scatterwalk_map);
static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
unsigned int more)
{
- if (out)
- flush_dcache_page(scatterwalk_page(walk));
+ if (out) {
+ struct page *page;
+
+ page = walk->sg->page + ((walk->offset - 1) >> PAGE_SHIFT);
+ flush_dcache_page(page);
+ }
if (more) {
walk->offset += PAGE_SIZE - 1;
OpenPOWER on IntegriCloud