summaryrefslogtreecommitdiff
path: root/fs/ubifs/master.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-05-02 08:31:18 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-08 08:32:15 +0300
commitf80df3851246ce5b9b7dd9625f3438e0f39383f1 (patch)
tree127df489a32f5d5179e33211550f5046978e8294 /fs/ubifs/master.c
parentea794db2646a3660647dd2f2c8f6f2770acc3596 (diff)
downloadlinux-f80df3851246ce5b9b7dd9625f3438e0f39383f1.tar.xz
ubifs: use crypto_shash_tfm_digest()
Instead of manually allocating a 'struct shash_desc' on the stack and calling crypto_shash_digest(), switch to using the new helper function crypto_shash_tfm_digest() which does this for us. Cc: linux-mtd@lists.infradead.org Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'fs/ubifs/master.c')
-rw-r--r--fs/ubifs/master.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ubifs/master.c b/fs/ubifs/master.c
index 52a85c01397e..911d0555b9f2 100644
--- a/fs/ubifs/master.c
+++ b/fs/ubifs/master.c
@@ -68,12 +68,9 @@ static int mst_node_check_hash(const struct ubifs_info *c,
u8 calc[UBIFS_MAX_HASH_LEN];
const void *node = mst;
- SHASH_DESC_ON_STACK(shash, c->hash_tfm);
-
- shash->tfm = c->hash_tfm;
-
- crypto_shash_digest(shash, node + sizeof(struct ubifs_ch),
- UBIFS_MST_NODE_SZ - sizeof(struct ubifs_ch), calc);
+ crypto_shash_tfm_digest(c->hash_tfm, node + sizeof(struct ubifs_ch),
+ UBIFS_MST_NODE_SZ - sizeof(struct ubifs_ch),
+ calc);
if (ubifs_check_hash(c, expected, calc))
return -EPERM;