summaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/kernel/pinmux.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-11-01 14:46:26 +0100
committerJesper Nilsson <jesper.nilsson@axis.com>2009-11-03 14:11:53 +0100
commitf25234f1c21ad9878bd38719381e13f4ef1990ce (patch)
treecd01c222db18d498223d33225f1acf6cb417626a /arch/cris/arch-v32/kernel/pinmux.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/eri... (diff)
downloadlinux-f25234f1c21ad9878bd38719381e13f4ef1990ce.tar.xz
linux-f25234f1c21ad9878bd38719381e13f4ef1990ce.zip
CRIS v32: Should index be positive?
`port' is used as index for writing to pins during allocation/deallocation. It should be positive. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch/cris/arch-v32/kernel/pinmux.c')
-rw-r--r--arch/cris/arch-v32/kernel/pinmux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/cris/arch-v32/kernel/pinmux.c b/arch/cris/arch-v32/kernel/pinmux.c
index 6eb54ea1c976..f6f3637a4194 100644
--- a/arch/cris/arch-v32/kernel/pinmux.c
+++ b/arch/cris/arch-v32/kernel/pinmux.c
@@ -54,7 +54,7 @@ crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode mode)
crisv32_pinmux_init();
- if (port > PORTS)
+ if (port > PORTS || port < 0)
return -EINVAL;
spin_lock_irqsave(&pinmux_lock, flags);
@@ -197,7 +197,7 @@ crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)
crisv32_pinmux_init();
- if (port > PORTS)
+ if (port > PORTS || port < 0)
return -EINVAL;
spin_lock_irqsave(&pinmux_lock, flags);