diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-06-14 21:04:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-19 14:56:24 -0400 |
commit | 76591bea9714a58d8924154068c78d702eb2cb17 (patch) | |
tree | a86298c07fb07dd53aaf4147a282cc2b06495c1a | |
parent | bcb7ad7bcbef030e6ba71ede1f9866368aca7c99 (diff) |
ath9k: fix a tx rate duration calculation bug
The rate pointer variable for a rate series is used in a loop before it is
initialized. This went unnoticed because it was used earlier for the RTS/CTS
rate. This bug can lead to the wrong PHY type being passed to the
duration calculation function.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index d59dd01d6cde..efb7f00f3561 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1001,13 +1001,13 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | /* legacy rates */ | 1003 | /* legacy rates */ |
1004 | rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; | ||
1004 | if ((tx_info->band == IEEE80211_BAND_2GHZ) && | 1005 | if ((tx_info->band == IEEE80211_BAND_2GHZ) && |
1005 | !(rate->flags & IEEE80211_RATE_ERP_G)) | 1006 | !(rate->flags & IEEE80211_RATE_ERP_G)) |
1006 | phy = WLAN_RC_PHY_CCK; | 1007 | phy = WLAN_RC_PHY_CCK; |
1007 | else | 1008 | else |
1008 | phy = WLAN_RC_PHY_OFDM; | 1009 | phy = WLAN_RC_PHY_OFDM; |
1009 | 1010 | ||
1010 | rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; | ||
1011 | info->rates[i].Rate = rate->hw_value; | 1011 | info->rates[i].Rate = rate->hw_value; |
1012 | if (rate->hw_value_short) { | 1012 | if (rate->hw_value_short) { |
1013 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | 1013 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |