Skip to content

Commit

Permalink
m32r: Should index be positive?
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Hirokazu Takata <[email protected]>
  • Loading branch information
RoelKluin authored and htakata committed Nov 3, 2009
1 parent 337214e commit 45cdd47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/m32r/kernel/smp.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 45cdd47

Please sign in to comment.