diff options
author | Bob Copeland <me@bobcopeland.com> | 2010-04-07 23:55:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-08 15:24:16 -0400 |
commit | 4f59fce9e099fb6ba3c8361e5094163a3efce5be (patch) | |
tree | 72da69ffda22e548bc608d5a5bcd87b8220497d4 /drivers/net/wireless/ath/ath5k | |
parent | a05988bbbef5ac2391fe696646f0b80708f33f2e (diff) | |
download | blackbird-op-linux-4f59fce9e099fb6ba3c8361e5094163a3efce5be.tar.gz blackbird-op-linux-4f59fce9e099fb6ba3c8361e5094163a3efce5be.zip |
ath5k: add bounds check to pdadc table
We check the bounds on pdadc once when correcting for
negative curves but not when we later copy values from
from the pdadc_tmp array, leading to a potential overrun.
Although we shouldn't hit this case in practice, let's
be consistent.
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index fcfc32d4da20..4a49dbb17352 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c @@ -2557,7 +2557,7 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah, max_idx = (pdadc_n < table_size) ? pdadc_n : table_size; /* Fill pdadc_out table */ - while (pdadc_0 < max_idx) + while (pdadc_0 < max_idx && pdadc_i < 128) pdadc_out[pdadc_i++] = pdadc_tmp[pdadc_0++]; /* Need to extrapolate above this pdgain? */ |