diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-03-30 22:58:20 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2007-03-30 22:58:20 -0400 |
commit | 9f1167272890c210399e6b8a32d7cf7295713f5d (patch) | |
tree | 5ace2f4d76d186b63270a4253eb85e6c12c47e2e /crypto | |
parent | 4ee531a3e661207d4b2174486b0f86017a3adb82 (diff) |
[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')
-rw-r--r-- | crypto/scatterwalk.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index 0f76175f623f..81afd1790a1d 100644 --- a/crypto/scatterwalk.c +++ b/crypto/scatterwalk.c | |||
@@ -59,8 +59,12 @@ EXPORT_SYMBOL_GPL(scatterwalk_map); | |||
59 | static void scatterwalk_pagedone(struct scatter_walk *walk, int out, | 59 | static void scatterwalk_pagedone(struct scatter_walk *walk, int out, |
60 | unsigned int more) | 60 | unsigned int more) |
61 | { | 61 | { |
62 | if (out) | 62 | if (out) { |
63 | flush_dcache_page(scatterwalk_page(walk)); | 63 | struct page *page; |
64 | |||
65 | page = walk->sg->page + ((walk->offset - 1) >> PAGE_SHIFT); | ||
66 | flush_dcache_page(page); | ||
67 | } | ||
64 | 68 | ||
65 | if (more) { | 69 | if (more) { |
66 | walk->offset += PAGE_SIZE - 1; | 70 | walk->offset += PAGE_SIZE - 1; |