public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] m32r: Should index be positive?
@ 2009-11-01 14:33 Roel Kluin
  2009-11-04  0:14 ` Hirokazu Takata
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-11-01 14:33 UTC (permalink / raw)
  To: Hirokazu Takata, linux-m32r, Andrew Morton, LKML

Index `ipi_num' is signed, test whether it is negative to
make sure we don't get a negative array element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 arch/m32r/kernel/smp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Found by code analysis, is it required?

diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
index 8a88f1f..31cef20 100644
--- a/arch/m32r/kernel/smp.c
+++ b/arch/m32r/kernel/smp.c
@@ -806,7 +806,7 @@ unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num,
 
 	if (mask & ~physids_coerce(phys_cpu_present_map))
 		BUG();
-	if (ipi_num >= NR_IPIS)
+	if (ipi_num >= NR_IPIS || ipi_num < 0)
 		BUG();
 
 	mask <<= IPI_SHIFT;

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

end of thread, other threads:[~2009-11-04  0:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-01 14:33 [PATCH] m32r: Should index be positive? Roel Kluin
2009-11-04  0:14 ` Hirokazu Takata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox