]> git.baikalelectronics.ru Git - kernel.git/commitdiff
m32r: Should index be positive?
authorRoel Kluin <roel.kluin@gmail.com>
Sun, 1 Nov 2009 14:33:06 +0000 (15:33 +0100)
committerHirokazu Takata <takata@linux-m32r.org>
Tue, 3 Nov 2009 23:39:26 +0000 (08:39 +0900)
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>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
arch/m32r/kernel/smp.c

index 8a88f1f0a3e2d7faab1fd065491340f076ccd82d..31cef20b2996fff82b836cd54b87c126ef42fa3a 100644 (file)
@@ -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;