diff options
Diffstat (limited to 'fs/ubifs/auth.c')
-rw-r--r-- | fs/ubifs/auth.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/fs/ubifs/auth.c b/fs/ubifs/auth.c index 60f43b93d06e..046fafbe1d38 100644 --- a/fs/ubifs/auth.c +++ b/fs/ubifs/auth.c @@ -77,13 +77,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); @@ -92,21 +88,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, |