Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6-microblaze.git] / fs / ubifs / auth.c
index 1e374ba..cc5c0ab 100644 (file)
@@ -65,13 +65,9 @@ int ubifs_prepare_auth_node(struct ubifs_info *c, void *node,
                             struct shash_desc *inhash)
 {
        struct ubifs_auth_node *auth = node;
-       u8 *hash;
+       u8 hash[UBIFS_HASH_ARR_SZ];
        int err;
 
-       hash = kmalloc(crypto_shash_descsize(c->hash_tfm), GFP_NOFS);
-       if (!hash)
-               return -ENOMEM;
-
        {
                SHASH_DESC_ON_STACK(hash_desc, c->hash_tfm);
 
@@ -80,21 +76,16 @@ int ubifs_prepare_auth_node(struct ubifs_info *c, void *node,
 
                err = crypto_shash_final(hash_desc, hash);
                if (err)
-                       goto out;
+                       return err;
        }
 
        err = ubifs_hash_calc_hmac(c, hash, auth->hmac);
        if (err)
-               goto out;
+               return err;
 
        auth->ch.node_type = UBIFS_AUTH_NODE;
        ubifs_prepare_node(c, auth, ubifs_auth_node_sz(c), 0);
-
-       err = 0;
-out:
-       kfree(hash);
-
-       return err;
+       return 0;
 }
 
 static struct shash_desc *ubifs_get_desc(const struct ubifs_info *c,