瀏覽代碼

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 <roel.kluin@gmail.com>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Roel Kluin 15 年之前
父節點
當前提交
45cdd47330
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/m32r/kernel/smp.c

+ 1 - 1
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))
 	if (mask & ~physids_coerce(phys_cpu_present_map))
 		BUG();
 		BUG();
-	if (ipi_num >= NR_IPIS)
+	if (ipi_num >= NR_IPIS || ipi_num < 0)
 		BUG();
 		BUG();
 
 
 	mask <<= IPI_SHIFT;
 	mask <<= IPI_SHIFT;