Re: [PATCH 1/2] crypto: iaa - Fix nr_cpus < nr_iaa case

From: Herbert Xu
Date: Fri Mar 22 2024 - 07:45:00 EST


On Thu, Mar 21, 2024 at 04:08:45PM -0500, Tom Zanussi wrote:
> If nr_cpus < nr_iaa, the calculated cpus_per_iaa will be 0, which
> causes a divide-by-0 in rebalance_wq_table().
>
> Make sure cpus_per_iaa is 1 in that case, and also in the nr_iaa == 0
> case, even though cpus_per_iaa is never used if nr_iaa == 0, for
> paranoia.
>
> Reported-by: Jerry Snitselaar <jsnitsel@xxxxxxxxxx>
> Signed-off-by: Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx>
> ---
> drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt