summaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-r2d
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-11-02 17:14:42 +0100
committerPaul Mundt <lethal@linux-sh.org>2009-11-04 03:48:07 +0100
commit9016332014404ae1dca7198f93804ac67ba9e918 (patch)
tree5823e797deb138ba18d1c441910d9781a8b7e561 /arch/sh/boards/mach-r2d
parentsh: Add RWDT save/restore code for sh7724 R-standby (diff)
downloadlinux-9016332014404ae1dca7198f93804ac67ba9e918.tar.xz
linux-9016332014404ae1dca7198f93804ac67ba9e918.zip
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 <roel.kluin@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-r2d')
-rw-r--r--arch/sh/boards/mach-r2d/irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
index c70fecedcac4..78d7b27c80da 100644
--- a/arch/sh/boards/mach-r2d/irq.c
+++ b/arch/sh/boards/mach-r2d/irq.c
@@ -116,7 +116,7 @@ static unsigned char irl2irq[R2D_NR_IRL];
int rts7751r2d_irq_demux(int irq)
{
- if (irq >= R2D_NR_IRL || !irl2irq[irq])
+ if (irq >= R2D_NR_IRL || irq < 0 || !irl2irq[irq])
return irq;
return irl2irq[irq];