From 3e185a56eb6968927049f2b3b8c95b3636d77ffd Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 1 May 2020 22:31:15 -0700 Subject: fscrypt: 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. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu --- fs/crypto/fname.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'fs/crypto/fname.c') diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index 4c212442a8f7..5c9fb013e3f7 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -83,13 +83,8 @@ static int fscrypt_do_sha256(const u8 *data, unsigned int data_len, u8 *result) tfm = prev_tfm; } } - { - SHASH_DESC_ON_STACK(desc, tfm); - desc->tfm = tfm; - - return crypto_shash_digest(desc, data, data_len, result); - } + return crypto_shash_tfm_digest(tfm, data, data_len, result); } static inline bool fscrypt_is_dot_dotdot(const struct qstr *str) -- cgit v1.2.3