diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-23 17:22:31 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-28 19:40:54 +0800 |
| commit | 2cfe41630a1a4f24d46825aa9656a51a38fb7f7d (patch) | |
| tree | 83c10c5937f5fc7e788ef1a37de2353b975d4b21 /crypto/shash.c | |
| parent | 19da081a28c95fe9b03ce952a2bf4a6f6bf5112c (diff) | |
| download | tip-2cfe41630a1a4f24d46825aa9656a51a38fb7f7d.tar.gz | |
crypto: hash - Fix clone error handling
Do not copy the exit function in crypto_clone_tfm as it should
only be set after init_tfm or clone_tfm has succeeded.
Move the setting into crypto_clone_ahash and crypto_clone_shash
instead.
Also clone the fb if necessary.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/shash.c')
| -rw-r--r-- | crypto/shash.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index b6c79a4a044a15..c4a724e55d7a69 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -413,6 +413,9 @@ struct crypto_shash *crypto_clone_shash(struct crypto_shash *hash) } } + if (alg->exit_tfm) + crypto_shash_tfm(nhash)->exit = crypto_shash_exit_tfm; + return nhash; } EXPORT_SYMBOL_GPL(crypto_clone_shash); |
