Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1229381 > unrolled thread

[PATCH 02/38] bus: arm-ccn: fix handling cpumask_any_but return value

Started byAndrzej Hajda <a.hajda@samsung.com>
First post2015-09-21 16:00 +0200
Last post2015-09-21 22:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 02/38] bus: arm-ccn: fix handling cpumask_any_but return value Andrzej Hajda <a.hajda@samsung.com> - 2015-09-21 16:00 +0200
    Re: [PATCH 02/38] bus: arm-ccn: fix handling cpumask_any_but return  value Pawel Moll <pawel.moll@foss.arm.com> - 2015-09-21 22:00 +0200

#1229381 — [PATCH 02/38] bus: arm-ccn: fix handling cpumask_any_but return value

FromAndrzej Hajda <a.hajda@samsung.com>
Date2015-09-21 16:00 +0200
Subject[PATCH 02/38] bus: arm-ccn: fix handling cpumask_any_but return value
Message-ID<qb9Np-8s4-53@gated-at.bofh.it>
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

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/bus/arm-ccn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 7d9879e..cc322fb 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);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1229702 — Re: [PATCH 02/38] bus: arm-ccn: fix handling cpumask_any_but return value

FromPawel Moll <pawel.moll@foss.arm.com>
Date2015-09-21 22:00 +0200
SubjectRe: [PATCH 02/38] bus: arm-ccn: fix handling cpumask_any_but return value
Message-ID<qbfpM-85w-3@gated-at.bofh.it>
In reply to#1229381
Dnia 2015-09-21, Mon o godzinie 15:33 +0200, Andrzej Hajda pisze:
> 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
> 
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>

This has been already reported and discussed:

	http://thread.gmane.org/gmane.linux.kernel.janitors/34058

but apparently slipped through cracks :-( therefore:

Acked-by: Pawel Moll <pawel.moll@arm.com>

Thanks for bringing it up again!

Pawel



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web