Commit b20519fd authored by Pawel Moll's avatar Pawel Moll Committed by Arnd Bergmann

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: default avatarDan Carpenter <>
Signed-off-by: default avatarPawel Moll <>
Signed-off-by: default avatarArnd Bergmann <>
parent f9e5ca86
......@@ -1184,7 +1184,7 @@ static int arm_ccn_pmu_cpu_notifier(struct notifier_block *nb,
if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu))
target = cpumask_any_but(cpu_online_mask, cpu);
if (target < 0)
if (target >= nr_cpu_ids)
perf_pmu_migrate_context(&dt->pmu, cpu, target);
cpumask_set_cpu(target, &dt->cpu);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment