X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=crypto%2Fscatterwalk.c;h=8b5969987c0d8ee03524ce7ffe8f1193cf29d84e;hp=41e529af0773181a115a04c932a1d38216745c06;hb=19277917a0db893344f247d2ed4ac920c874f0d6;hpb=800f65bba8d2030b3fef62850e203f9f176625a8 diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index 41e529af0773..8b5969987c0d 100644 --- a/crypto/scatterwalk.c +++ b/crypto/scatterwalk.c @@ -68,7 +68,8 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out, void scatterwalk_done(struct scatter_walk *walk, int out, int more) { - if (!(scatterwalk_pagelen(walk) & (PAGE_SIZE - 1)) || !more) + if (!more || walk->offset >= walk->sg->offset + walk->sg->length || + !(walk->offset & (PAGE_SIZE - 1))) scatterwalk_pagedone(walk, out, more); } EXPORT_SYMBOL_GPL(scatterwalk_done);