summaryrefslogtreecommitdiffstats
path: root/drivers/bus/arm-ccn.c
diff options
context:
space:
mode:
authorPawel Moll <pawel.moll@arm.com>2015-10-15 15:32:45 +0200
committerArnd Bergmann <arnd@arndb.de>2015-10-15 17:10:02 +0200
commitb20519fd5007908c6a816cab1b9db911915e9fbd (patch)
tree27a98db1c8e54c655c33bf08de82c05f0f3aadd6 /drivers/bus/arm-ccn.c
parentARM: meson6: DTS: Fix wrong reg mapping and IRQ numbers (diff)
downloadlinux-b20519fd5007908c6a816cab1b9db911915e9fbd.tar.xz
linux-b20519fd5007908c6a816cab1b9db911915e9fbd.zip
bus: arm-ccn: Handle correctly no-more-cpus case
When migrating events the driver picks another cpu using cpumask_any_but() function, which returns value >= nr_cpu_ids when there is none available, not a negative value as the code assumed. Fixed now. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/bus/arm-ccn.c')
-rw-r--r--drivers/bus/arm-ccn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 7d9879e166cf..cc322fbde9af 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -1184,7 +1184,7 @@ static int arm_ccn_pmu_cpu_notifier(struct notifier_block *nb,
if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu))
break;
target = cpumask_any_but(cpu_online_mask, cpu);
- if (target < 0)
+ if (target >= nr_cpu_ids)
break;
perf_pmu_migrate_context(&dt->pmu, cpu, target);
cpumask_set_cpu(target, &dt->cpu);