[PATCH 1/3] Add sanity check into __bind_irq_vector

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add some sanity checks into __bind_irq_vector().

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx>

---
 arch/ia64/kernel/irq_ia64.c |    3 +++
 1 files changed, 3 insertions(+)

Index: linux-2.6.23-rc1/arch/ia64/kernel/irq_ia64.c
===================================================================
--- linux-2.6.23-rc1.orig/arch/ia64/kernel/irq_ia64.c
+++ linux-2.6.23-rc1/arch/ia64/kernel/irq_ia64.c
@@ -145,6 +145,9 @@ static int __bind_irq_vector(int irq, in
 	int cpu;
 	struct irq_cfg *cfg = &irq_cfg[irq];
 
+	BUG_ON((unsigned)irq >= NR_IRQS);
+	BUG_ON((unsigned)vector >= IA64_NUM_VECTORS);
+
 	cpus_and(mask, domain, cpu_online_map);
 	if (cpus_empty(mask))
 		return -EINVAL;


-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux