All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq: fixup checks against nr_cpu_ids
@ 2017-08-19  9:57 Alexey Dobriyan
  2017-08-20  8:56 ` [tip:irq/urgent] genirq/ipi: Fixup " tip-bot for Alexey Dobriyan
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2017-08-19  9:57 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel

Valid CPU ids are [0, nr_cpu_ids-1] inclusive.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 kernel/irq/ipi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/irq/ipi.c
+++ b/kernel/irq/ipi.c
@@ -165,7 +165,7 @@ irq_hw_number_t ipi_get_hwirq(unsigned int irq, unsigned int cpu)
 	struct irq_data *data = irq_get_irq_data(irq);
 	struct cpumask *ipimask = data ? irq_data_get_affinity_mask(data) : NULL;
 
-	if (!data || !ipimask || cpu > nr_cpu_ids)
+	if (!data || !ipimask || cpu >= nr_cpu_ids)
 		return INVALID_HWIRQ;
 
 	if (!cpumask_test_cpu(cpu, ipimask))
@@ -195,7 +195,7 @@ static int ipi_send_verify(struct irq_chip *chip, struct irq_data *data,
 	if (!chip->ipi_send_single && !chip->ipi_send_mask)
 		return -EINVAL;
 
-	if (cpu > nr_cpu_ids)
+	if (cpu >= nr_cpu_ids)
 		return -EINVAL;
 
 	if (dest) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:irq/urgent] genirq/ipi: Fixup checks against nr_cpu_ids
  2017-08-19  9:57 [PATCH] genirq: fixup checks against nr_cpu_ids Alexey Dobriyan
@ 2017-08-20  8:56 ` tip-bot for Alexey Dobriyan
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Alexey Dobriyan @ 2017-08-20  8:56 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: tglx, linux-kernel, hpa, mingo, adobriyan

Commit-ID:  8fbbe2d7cc478d1544f41f2271787c993c23a4f6
Gitweb:     http://git.kernel.org/tip/8fbbe2d7cc478d1544f41f2271787c993c23a4f6
Author:     Alexey Dobriyan <adobriyan@gmail.com>
AuthorDate: Sat, 19 Aug 2017 12:57:51 +0300
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 20 Aug 2017 10:49:05 +0200

genirq/ipi: Fixup checks against nr_cpu_ids

Valid CPU ids are [0, nr_cpu_ids-1] inclusive.

Fixes: 3b8e29a82dd1 ("genirq: Implement ipi_send_mask/single()")
Fixes: f9bce791ae2a ("genirq: Add a new function to get IPI reverse mapping")
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20170819095751.GB27864@avx2

---
 kernel/irq/ipi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/ipi.c b/kernel/irq/ipi.c
index 1a9abc1..259a22a 100644
--- a/kernel/irq/ipi.c
+++ b/kernel/irq/ipi.c
@@ -165,7 +165,7 @@ irq_hw_number_t ipi_get_hwirq(unsigned int irq, unsigned int cpu)
 	struct irq_data *data = irq_get_irq_data(irq);
 	struct cpumask *ipimask = data ? irq_data_get_affinity_mask(data) : NULL;
 
-	if (!data || !ipimask || cpu > nr_cpu_ids)
+	if (!data || !ipimask || cpu >= nr_cpu_ids)
 		return INVALID_HWIRQ;
 
 	if (!cpumask_test_cpu(cpu, ipimask))
@@ -195,7 +195,7 @@ static int ipi_send_verify(struct irq_chip *chip, struct irq_data *data,
 	if (!chip->ipi_send_single && !chip->ipi_send_mask)
 		return -EINVAL;
 
-	if (cpu > nr_cpu_ids)
+	if (cpu >= nr_cpu_ids)
 		return -EINVAL;
 
 	if (dest) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-20  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-19  9:57 [PATCH] genirq: fixup checks against nr_cpu_ids Alexey Dobriyan
2017-08-20  8:56 ` [tip:irq/urgent] genirq/ipi: Fixup " tip-bot for Alexey Dobriyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.