summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2008-05-13 05:16:44 +0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-15 00:29:50 +0400
commitd6894b5be1d674a31a94ed8f057c9f7d98c53999 (patch)
tree6d7ba98e768595f31505e29e5bfcb83d06b5b3d4 /drivers/net/wireless/ath5k/base.c
parentb0a6717994a4e00ee19372e1bdaab53572ae025c (diff)
downloadlinux-d6894b5be1d674a31a94ed8f057c9f7d98c53999.tar.xz
ath5k: Fix loop variable initializations
In ath5k_tasklet_rx, both status structures 'rxs' and 'rs' are initialized at the top of the tasklet, but not within the loop. If the loop is executed multiple times in the tasklet then the variables may see changes from previous packets. For TKIP, this results in 'Invalid Michael MIC' errors if two packets are processed in the tasklet: rxs.flag gets set to RX_DECRYPTED by mac80211 when it decrypts the first encrypted packet. The subsequent packet will have RX_DECRYPTED set upon entry to mac80211, so mac80211 will not try to decrypt it. We currently initialize all but two fields in the structures, so fix the other two. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index dd8adaddd7a0..c76ada178781 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1785,6 +1785,8 @@ ath5k_tasklet_rx(unsigned long data)
spin_lock(&sc->rxbuflock);
do {
+ rxs.flag = 0;
+
if (unlikely(list_empty(&sc->rxbuf))) {
ATH5K_WARN(sc, "empty rx buf pool\n");
break;