X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fahash.c;h=f669822a7a443c81a04c8fb61d8d382a64546542;hb=d25e6b0b326278a1096e8334584c3e64517057a3;hp=b8c59b889c6ea579e7a6bacd7241bbbc86cbe44c;hpb=55ddf14b04bfe5afaab892a8fb12164b803f1dd5;p=pandora-kernel.git diff --git a/crypto/ahash.c b/crypto/ahash.c index b8c59b889c6e..f669822a7a44 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -47,8 +47,11 @@ static int hash_walk_next(struct crypto_hash_walk *walk) walk->data = crypto_kmap(walk->pg, 0); walk->data += offset; - if (offset & alignmask) - nbytes = alignmask + 1 - (offset & alignmask); + if (offset & alignmask) { + unsigned int unaligned = alignmask + 1 - (offset & alignmask); + if (nbytes > unaligned) + nbytes = unaligned; + } walk->entrylen -= nbytes; return nbytes;