summaryrefslogtreecommitdiffstats
path: root/crypto/ahash.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-09-09 22:38:43 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-09-09 22:38:43 +0100
commitde9ea203d105f760e8e995c07aa80e855a9aedba (patch)
tree75e4702e98a0b3ea9ed6d085f74474a70642909b /crypto/ahash.c
parent2be23c475af8ae4e25f8bab08d815b17593bd547 (diff)
parentd56557af19867edb8c0e96f8e26399698a08857f (diff)
Merge branch 'origin'
Diffstat (limited to 'crypto/ahash.c')
-rw-r--r--crypto/ahash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c
index b8c59b889c6..f669822a7a4 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;