diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2016-02-23 13:49:44 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-03-01 02:23:16 +0300 |
commit | 0f17380c1aae80fe0f2fa495cb627ba750b693de (patch) | |
tree | d2a2d19a38e3c2ffc2b9ded0417c3b075a571ca2 /drivers/bus/arm-cci.c | |
parent | 5e442eba342e567e2b3f1a39a24f81559f8370f7 (diff) | |
download | linux-0f17380c1aae80fe0f2fa495cb627ba750b693de.tar.xz |
arm-cci: fix handling cpumask_any_but return value
cpumask_any_but returns value >= nr_cpu_ids if there are no more CPUs.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/bus/arm-cci.c')
-rw-r--r-- | drivers/bus/arm-cci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index ee47e6be9ab9..5fb1c06e0020 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -1270,7 +1270,7 @@ static int cci_pmu_cpu_notifier(struct notifier_block *self, if (!cpumask_test_and_clear_cpu(cpu, &cci_pmu->cpus)) break; target = cpumask_any_but(cpu_online_mask, cpu); - if (target < 0) // UP, last CPU + if (target >= nr_cpu_ids) // UP, last CPU break; /* * TODO: migrate context once core races on event->ctx have |