X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fscatterwalk.c;h=81afd1790a1d1c28fc8a7e2569940401a668d5ac;hb=61ec7567db103d537329b0db9a887db570431ff4;hp=a66423121773a8f2419e359b3812dd641640fdd3;hpb=8559840c4ca3f2fff73a882803bc8916078fac1f;p=pandora-kernel.git diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index a66423121773..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; @@ -91,7 +95,7 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk, memcpy_dir(buf, vaddr, len_this_page, out); scatterwalk_unmap(vaddr, out); - scatterwalk_advance(walk, nbytes); + scatterwalk_advance(walk, len_this_page); if (nbytes == len_this_page) break;