mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[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>
This commit is contained in:
parent
10d5d99e88
commit
7df56c2586
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue