Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[sfrench/cifs-2.6.git] / crypto / hash.c
index 4d75ca7b57b207fd2466b8adc03e0d42615150e7..7dcff671c19b6d91a6127467b57c4db91a23fff4 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/seq_file.h>
 
 #include "internal.h"
@@ -40,13 +41,13 @@ static int hash_setkey_unaligned(struct crypto_hash *crt, const u8 *key,
        alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
        memcpy(alignbuffer, key, keylen);
        ret = alg->setkey(crt, alignbuffer, keylen);
-       memset(alignbuffer, 0, absize);
+       memset(alignbuffer, 0, keylen);
        kfree(buffer);
        return ret;
 }
 
 static int hash_setkey(struct crypto_hash *crt, const u8 *key,
-               unsigned int keylen)
+                      unsigned int keylen)
 {
        struct crypto_tfm *tfm = crypto_hash_tfm(crt);
        struct hash_alg *alg = &tfm->__crt_alg->cra_hash;