diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2010-07-20 02:52:20 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-07-26 02:13:59 -0400 |
commit | cc74f4bc111e9554bcd6445ad0fe1d90e5d2eb34 (patch) | |
tree | 9848a74caacea30210ed680362fe8ee0aec51a69 /crypto | |
parent | 7424713b83587006da72da84d7922471e366faba (diff) |
crypto: pcrypt - Dont calulate a callback cpu on empty callback cpumask
If the callback cpumask is empty, we crash with a division by zero
when we try to calculate a callback cpu. So we don't update the callback
cpu in pcrypt_do_parallel if the callback cpumask is empty.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/pcrypt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c index 7153a50bce27..794c172b99f7 100644 --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c | |||
@@ -82,6 +82,9 @@ static int pcrypt_do_parallel(struct padata_priv *padata, unsigned int *cb_cpu, | |||
82 | if (cpumask_test_cpu(cpu, cpumask->mask)) | 82 | if (cpumask_test_cpu(cpu, cpumask->mask)) |
83 | goto out; | 83 | goto out; |
84 | 84 | ||
85 | if (!cpumask_weight(cpumask->mask)) | ||
86 | goto out; | ||
87 | |||
85 | cpu_index = cpu % cpumask_weight(cpumask->mask); | 88 | cpu_index = cpu % cpumask_weight(cpumask->mask); |
86 | 89 | ||
87 | cpu = cpumask_first(cpumask->mask); | 90 | cpu = cpumask_first(cpumask->mask); |