From 9016332014404ae1dca7198f93804ac67ba9e918 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Mon, 2 Nov 2009 16:14:42 +0000 Subject: sh: Make sure indexes are positive The indexes are signed, make sure they are not negative when we read array elements. Signed-off-by: Roel Kluin Signed-off-by: Paul Mundt --- arch/sh/boards/mach-highlander/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sh/boards/mach-highlander') diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c index 566e69d8d729..f663c14d8885 100644 --- a/arch/sh/boards/mach-highlander/setup.c +++ b/arch/sh/boards/mach-highlander/setup.c @@ -384,7 +384,7 @@ static unsigned char irl2irq[HL_NR_IRL]; static int highlander_irq_demux(int irq) { - if (irq >= HL_NR_IRL || !irl2irq[irq]) + if (irq >= HL_NR_IRL || irq < 0 || !irl2irq[irq]) return irq; return irl2irq[irq]; -- cgit v1.2.3