diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-11-13 11:37:34 +0100 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-11-17 00:50:10 +0800 |
commit | 7df56c2586049a06b007474ca059779c81ddb1ff (patch) | |
tree | 3853675bae18a130b5ed98d084c38c730663c6cd /arch/arm/plat-pxa | |
parent | 10d5d99e880692a31ddc59b9f5d063e928fc0c89 (diff) | |
download | op-kernel-dev-7df56c2586049a06b007474ca059779c81ddb1ff.zip op-kernel-dev-7df56c2586049a06b007474ca059779c81ddb1ff.tar.gz |
[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/plat-pxa')
-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 9405d03..be58f9f 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); |