提交 9f116727 编写于 作者: H Herbert Xu

[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: NHerbert Xu <herbert@gondor.apana.org.au>
上级 4ee531a3
...@@ -59,8 +59,12 @@ EXPORT_SYMBOL_GPL(scatterwalk_map); ...@@ -59,8 +59,12 @@ EXPORT_SYMBOL_GPL(scatterwalk_map);
static void scatterwalk_pagedone(struct scatter_walk *walk, int out, static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
unsigned int more) unsigned int more)
{ {
if (out) if (out) {
flush_dcache_page(scatterwalk_page(walk)); struct page *page;
page = walk->sg->page + ((walk->offset - 1) >> PAGE_SHIFT);
flush_dcache_page(page);
}
if (more) { if (more) {
walk->offset += PAGE_SIZE - 1; walk->offset += PAGE_SIZE - 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册