crypto: iaa - Account for cpu-less numa nodes
authorTom Zanussi <tom.zanussi@linux.intel.com>
Wed, 27 Dec 2023 20:28:32 +0000 (14:28 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 29 Dec 2023 03:25:56 +0000 (11:25 +0800)
commitb8910630c967ffee582289451ddb5f9f19c26872
tree098b15d872eb86d3b250481cc54b95544dff822f
parent744e1885922a9943458954cfea917b31064b4131
crypto: iaa - Account for cpu-less numa nodes

In some configurations e.g. systems with CXL, a numa node can have 0
cpus and cpumask_nth() will return a cpu value that doesn't exist,
which will result in an attempt to add an entry to the wq table at a
bad index.

To fix this, when iterating the cpus for a node, skip any node that
doesn't have cpus.

Also, as a precaution, add a warning and bail if cpumask_nth() returns
a nonexistent cpu.

Reported-by: Zhang, Rex <rex.zhang@intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/intel/iaa/iaa_crypto_main.c