diff options
author | Barry Song <barry.song@analog.com> | 2009-09-16 04:36:29 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-12-15 00:13:46 -0500 |
commit | 89e84eeace5924f29a4f8f25cce9fcb083969974 (patch) | |
tree | 95f2471d436918a2673c2a636594ea6c119210a5 /arch/blackfin/kernel | |
parent | 298571249a1990cd3c6c6ab40250a4a9c18ab5d1 (diff) | |
download | kernel_samsung_aries-89e84eeace5924f29a4f8f25cce9fcb083969974.zip kernel_samsung_aries-89e84eeace5924f29a4f8f25cce9fcb083969974.tar.gz kernel_samsung_aries-89e84eeace5924f29a4f8f25cce9fcb083969974.tar.bz2 |
Blackfin: add some bounds checking to peripheral_request
The requested peripheral is turned into an index into some state arrays,
so make sure the calculated index doesn't exceed the index. This occurs
when using bogus pin values or the define headers are screwed up. Now
we'll notice right away that something needs fixing instead of trying to
track down random memory corruption.
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 22705ee..c4161e0 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -762,6 +762,8 @@ int peripheral_request(unsigned short per, const char *label) if (!(per & P_DEFINED)) return -ENODEV; + BUG_ON(ident >= MAX_RESOURCES); + local_irq_save_hw(flags); /* If a pin can be muxed as either GPIO or peripheral, make |