[PATCH] crypto api: Use the right value when advancing scatterwalk_copychunks
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 31 Mar 2007 02:14:37 +0000 (12:14 +1000)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 31 Mar 2007 02:26:33 +0000 (19:26 -0700)
In the scatterwalk_copychunks loop, We should be advancing by
len_this_page and not nbytes.  The latter is the total length.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
crypto/scatterwalk.c

index a66423121773a8f2419e359b3812dd641640fdd3..0f76175f623fe9172566568f63124407225ce55e 100644 (file)
@@ -91,7 +91,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;