aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/ahash.c7
1 files changed, 5 insertions, 2 deletions
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)
47 walk->data = crypto_kmap(walk->pg, 0); 47 walk->data = crypto_kmap(walk->pg, 0);
48 walk->data += offset; 48 walk->data += offset;
49 49
50 if (offset & alignmask) 50 if (offset & alignmask) {
51 nbytes = alignmask + 1 - (offset & alignmask); 51 unsigned int unaligned = alignmask + 1 - (offset & alignmask);
52 if (nbytes > unaligned)
53 nbytes = unaligned;
54 }
52 55
53 walk->entrylen -= nbytes; 56 walk->entrylen -= nbytes;
54 return nbytes; 57 return nbytes;