Skip to content

Commit

Permalink
ath5k/phy.c: fix negative array index
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Feb 29, 2008
1 parent 6844e63 commit e71c9fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath5k/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah,
(channel->center_freq >= 5260 ? 1 :
(channel->center_freq > 4000 ? 0 : -1)));

if (obdb == -1)
return -EINVAL;

if (!ath5k_hw_rfregs_op(rf, ah->ah_offset[6],
ee->ee_ob[ee_mode][obdb], 3, 279, 0, true))
return -EINVAL;
Expand Down

0 comments on commit e71c9fa

Please sign in to comment.