diff options
author | Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> | 2008-02-03 21:53:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:19:38 -0500 |
commit | e71c9fac316221a4594f3bd58c2d30ada0cabaf6 (patch) | |
tree | b178376036c5122e06fe47f63dd450e40e7df87e /drivers/net/wireless/ath5k | |
parent | 6844e63a9458d15b4437aa467c99128d994b0f6c (diff) |
ath5k/phy.c: fix negative array index
Author: Adrian Bunk <bunk@kernel.org>
This patch fixes a negative array index spotted by the Coverity checker.
Changes-licensed-under: ISC
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r-- | drivers/net/wireless/ath5k/phy.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c index 248c0f545f24..405195ffb24d 100644 --- a/drivers/net/wireless/ath5k/phy.c +++ b/drivers/net/wireless/ath5k/phy.c | |||
@@ -1178,6 +1178,9 @@ static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah, | |||
1178 | (channel->center_freq >= 5260 ? 1 : | 1178 | (channel->center_freq >= 5260 ? 1 : |
1179 | (channel->center_freq > 4000 ? 0 : -1))); | 1179 | (channel->center_freq > 4000 ? 0 : -1))); |
1180 | 1180 | ||
1181 | if (obdb == -1) | ||
1182 | return -EINVAL; | ||
1183 | |||
1181 | if (!ath5k_hw_rfregs_op(rf, ah->ah_offset[6], | 1184 | if (!ath5k_hw_rfregs_op(rf, ah->ah_offset[6], |
1182 | ee->ee_ob[ee_mode][obdb], 3, 279, 0, true)) | 1185 | ee->ee_ob[ee_mode][obdb], 3, 279, 0, true)) |
1183 | return -EINVAL; | 1186 | return -EINVAL; |