aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ahash.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-09-14 16:15:29 +0200
committerTakashi Iwai <tiwai@suse.de>2010-09-14 16:15:29 +0200
commitf3fbba6efbab93b9850821d41a75b02286d18315 (patch)
treee2a680674d334c6e455d1a89a4dbfc3f549cb6d1 /crypto/ahash.c
parentALSA: snd-usb-caiaq: Add support for Traktor Kontrol S4 (diff)
parentsound: Remove pr_<level> uses of KERN_<level> (diff)
downloadlinux-dev-f3fbba6efbab93b9850821d41a75b02286d18315.tar.xz
linux-dev-f3fbba6efbab93b9850821d41a75b02286d18315.zip
Merge branch 'fix/misc' into topic/misc
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 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;