From: Herbert Xu Date: Sat, 31 Mar 2007 02:58:20 +0000 (+1000) Subject: [CRYPTO] api: Flush the current page right than the next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f1167272890c210399e6b8a32d7cf7295713f5d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [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 --- 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); 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;