Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] crypto api: Use the right value when advancing scatterwalk_copychunks

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>

authored by

Herbert Xu and committed by
Linus Torvalds
beff804d c35e584c

+1 -1
+1 -1
crypto/scatterwalk.c
··· 91 91 memcpy_dir(buf, vaddr, len_this_page, out); 92 92 scatterwalk_unmap(vaddr, out); 93 93 94 - scatterwalk_advance(walk, nbytes); 94 + scatterwalk_advance(walk, len_this_page); 95 95 96 96 if (nbytes == len_this_page) 97 97 break;