Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: mediatek - 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 <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
e0077ea8 61c38e3a

+2 -5
+2 -5
drivers/crypto/mediatek/mtk-sha.c
··· 805 805 size_t ds = crypto_shash_digestsize(bctx->shash); 806 806 int err, i; 807 807 808 - SHASH_DESC_ON_STACK(shash, bctx->shash); 809 - 810 - shash->tfm = bctx->shash; 811 - 812 808 if (keylen > bs) { 813 - err = crypto_shash_digest(shash, key, keylen, bctx->ipad); 809 + err = crypto_shash_tfm_digest(bctx->shash, key, keylen, 810 + bctx->ipad); 814 811 if (err) 815 812 return err; 816 813 keylen = ds;