From: Roel Kluin Date: Sun, 1 Nov 2009 14:33:06 +0000 (+0100) Subject: m32r: Should index be positive? X-Git-Tag: v2.6.32-rc7~76^2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=45cdd473301aae36e1f10664b9fe7ef5aad3f182;p=~shefty%2Frdma-dev.git m32r: Should index be positive? 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 Signed-off-by: Hirokazu Takata --- diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c index 8a88f1f0a3e..31cef20b299 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;