aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-01-22 12:33:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-22 12:39:14 -0500
commite4fca007b06165900d0e44e8d5e251376819bf5d (patch)
tree3abf108c8ff0ab50de3875bd1dd5b05454e30f98 /net
parent64147c729732ba9c9e50966971bdfbd503c888bb (diff)
mac80211: avoid NULL ptr deref when using WEP
"mac80211: move control.hw_key assignment" changed an if-else into two separate if statments, but the if-else is needed to prevent dereferencing a null info->control.hw_key. This fixes avoids a lock-up during association on my machine when using WEP. Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/wep.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index 0a4c641c9605..5d745f2d7236 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -310,9 +310,8 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
310 tx->key->conf.keylen, 310 tx->key->conf.keylen,
311 tx->key->conf.keyidx)) 311 tx->key->conf.keyidx))
312 return -1; 312 return -1;
313 } 313 } else if (info->control.hw_key->flags &
314 314 IEEE80211_KEY_FLAG_GENERATE_IV) {
315 if (info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) {
316 if (!ieee80211_wep_add_iv(tx->local, skb, 315 if (!ieee80211_wep_add_iv(tx->local, skb,
317 tx->key->conf.keylen, 316 tx->key->conf.keylen,
318 tx->key->conf.keyidx)) 317 tx->key->conf.keyidx))