diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-03-25 20:48:23 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-03-25 20:48:23 +0300 |
commit | 174fdc93a241af54772ae3e745ec719e9f6cebfc (patch) | |
tree | afdc8399f4a17c763966e0dc25b671af24570485 /drivers/crypto | |
parent | 4cece764965020c22cff7665b18a012006359095 (diff) | |
parent | 5a7e89d3315d1be86aff8a8bf849023cda6547f7 (diff) | |
download | linux-174fdc93a241af54772ae3e745ec719e9f6cebfc.tar.xz |
Merge tag 'v6.9-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
"This fixes a regression that broke iwd as well as a divide by zero in
iaa"
* tag 'v6.9-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: iaa - Fix nr_cpus < nr_iaa case
Revert "crypto: pkcs7 - remove sha1 support"
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index 1cd304de5388..b2191ade9011 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -806,6 +806,8 @@ static int save_iaa_wq(struct idxd_wq *wq) return -EINVAL; cpus_per_iaa = (nr_nodes * nr_cpus_per_node) / nr_iaa; + if (!cpus_per_iaa) + cpus_per_iaa = 1; out: return 0; } @@ -821,10 +823,12 @@ static void remove_iaa_wq(struct idxd_wq *wq) } } - if (nr_iaa) + if (nr_iaa) { cpus_per_iaa = (nr_nodes * nr_cpus_per_node) / nr_iaa; - else - cpus_per_iaa = 0; + if (!cpus_per_iaa) + cpus_per_iaa = 1; + } else + cpus_per_iaa = 1; } static int wq_table_add_wqs(int iaa, int cpu) |