diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-11-13 13:37:34 +0300 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-11-16 19:50:10 +0300 |
commit | 7df56c2586049a06b007474ca059779c81ddb1ff (patch) | |
tree | 3853675bae18a130b5ed98d084c38c730663c6cd /arch/arm | |
parent | 10d5d99e880692a31ddc59b9f5d063e928fc0c89 (diff) | |
download | linux-7df56c2586049a06b007474ca059779c81ddb1ff.tar.xz |
[ARM] pxa: ensure mfp is in correct range in mfp_{read,write}
Ensure we do not read/write outside array boundaries with a negative index.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-pxa/mfp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/plat-pxa/mfp.c b/arch/arm/plat-pxa/mfp.c index 9405d0379c85..be58f9fe65b0 100644 --- a/arch/arm/plat-pxa/mfp.c +++ b/arch/arm/plat-pxa/mfp.c @@ -207,7 +207,7 @@ unsigned long mfp_read(int mfp) { unsigned long val, flags; - BUG_ON(mfp >= MFP_PIN_MAX); + BUG_ON(mfp < 0 || mfp >= MFP_PIN_MAX); spin_lock_irqsave(&mfp_spin_lock, flags); val = mfpr_readl(mfp_table[mfp].mfpr_off); @@ -220,7 +220,7 @@ void mfp_write(int mfp, unsigned long val) { unsigned long flags; - BUG_ON(mfp >= MFP_PIN_MAX); + BUG_ON(mfp < 0 || mfp >= MFP_PIN_MAX); spin_lock_irqsave(&mfp_spin_lock, flags); mfpr_writel(mfp_table[mfp].mfpr_off, val); |