diff options
author | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2021-05-11 16:08:17 +0000 |
---|---|---|
committer | Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com> | 2021-05-11 16:08:17 +0000 |
commit | ba4e63325c88889dc147563e5d7e33223389794e (patch) | |
tree | 1222d62f37c1c12a167f3cc47bdb85bb5359ec25 /crypto | |
parent | 3ec285efe932699470c60430ea53d8753d705891 (diff) | |
parent | 16022114de9869743d6304290815cdb8a8c7deaa (diff) |
Merge tag 'v5.4.118' into 5.4-2.3.x-imx
This is the 5.4.118 stable release
Conflicts (manual resolve):
- drivers/mmc/core/core.c:
- drivers/mmc/core/host.c:
Fix merge fuzz for upstream commit 909a01b95120 ("mmc: core: Fix hanging
on I/O during system suspend for removable cards")
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/api.c | 2 | ||||
-rw-r--r-- | crypto/rng.c | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/crypto/api.c b/crypto/api.c index eda0c56b8615..c71d1485541c 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -568,7 +568,7 @@ void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm) { struct crypto_alg *alg; - if (unlikely(!mem)) + if (IS_ERR_OR_NULL(mem)) return; alg = tfm->__crt_alg; diff --git a/crypto/rng.c b/crypto/rng.c index 1490d210f1a1..608d6ce1440a 100644 --- a/crypto/rng.c +++ b/crypto/rng.c @@ -34,22 +34,18 @@ int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) u8 *buf = NULL; int err; - crypto_stats_get(alg); if (!seed && slen) { buf = kmalloc(slen, GFP_KERNEL); - if (!buf) { - crypto_alg_put(alg); + if (!buf) return -ENOMEM; - } err = get_random_bytes_wait(buf, slen); - if (err) { - crypto_alg_put(alg); + if (err) goto out; - } seed = buf; } + crypto_stats_get(alg); err = crypto_rng_alg(tfm)->seed(tfm, seed, slen); crypto_stats_rng_seed(alg, err); out: |