diff options
Diffstat (limited to 'security/integrity/ima/ima_crypto.c')
-rw-r--r-- | security/integrity/ima/ima_crypto.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index 0bd732843fe7..2d103dc13d90 100644 --- a/security/integrity/ima/ima_crypto.c +++ b/security/integrity/ima/ima_crypto.c | |||
@@ -200,7 +200,10 @@ static struct crypto_ahash *ima_alloc_atfm(enum hash_algo algo) | |||
200 | struct crypto_ahash *tfm = ima_ahash_tfm; | 200 | struct crypto_ahash *tfm = ima_ahash_tfm; |
201 | int rc; | 201 | int rc; |
202 | 202 | ||
203 | if ((algo != ima_hash_algo && algo < HASH_ALGO__LAST) || !tfm) { | 203 | if (algo < 0 || algo >= HASH_ALGO__LAST) |
204 | algo = ima_hash_algo; | ||
205 | |||
206 | if (algo != ima_hash_algo || !tfm) { | ||
204 | tfm = crypto_alloc_ahash(hash_algo_name[algo], 0, 0); | 207 | tfm = crypto_alloc_ahash(hash_algo_name[algo], 0, 0); |
205 | if (!IS_ERR(tfm)) { | 208 | if (!IS_ERR(tfm)) { |
206 | if (algo == ima_hash_algo) | 209 | if (algo == ima_hash_algo) |