From: Luis R. Rodriguez Date: Mon, 4 Feb 2008 02:53:51 +0000 (-0500) Subject: ath5k/phy.c: fix negative array index X-Git-Tag: v2.6.26-rc1~1138^2~530^2~102 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e71c9fac316221a4594f3bd58c2d30ada0cabaf6;p=linux-2.6-omap-h63xx.git ath5k/phy.c: fix negative array index Author: Adrian Bunk This patch fixes a negative array index spotted by the Coverity checker. Changes-licensed-under: ISC Acked-by: Nick Kossifidis Signed-off-by: Adrian Bunk Signed-off-by: Luis R. Rodriguez Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c index 248c0f545f2..405195ffb24 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, (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;