diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-07 17:35:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-07 17:35:16 -0400 |
commit | 61f953cbaae26f930b8d937366270547e08c1290 (patch) | |
tree | 44cefef0fdd172ce4fe2083ed7695d86b76ed257 /crypto/ahash.c | |
parent | a44a553f827f28d46130c9818dbcb95f4262b96c (diff) | |
parent | 50b6e71ae83714be509b80727dbf90fa8b1c0717 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
Revert "hwrng: n2-drv - remove casts from void*"
crypto: testmgr - Default to no tests
crypto: testmgr - Fix test disabling option
crypto: hash - Fix handling of small unaligned buffers
Diffstat (limited to 'crypto/ahash.c')
-rw-r--r-- | crypto/ahash.c | 7 |
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; |