mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
ath9k: fix crash with WEP in ad-hoc mode
Commit eed8e22f01
added support for using
multicast key lookup to support per-vif/sta keys for AP and ad-hoc.
Unfortunately, it also introduced a crash in ad-hoc mode when the sta
pointer is NULL, which happens when setting up an interface with WEP
keys. This patch fixes it by falling back to the assigned key index.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
347809fc2c
commit
8e67ca7c92
@ -319,6 +319,10 @@ int ath9k_cmn_key_config(struct ath_common *common,
|
||||
idx = ath_reserve_key_cache_slot(common, key->alg);
|
||||
break;
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
if (!sta) {
|
||||
idx = key->keyidx;
|
||||
break;
|
||||
}
|
||||
memcpy(gmac, sta->addr, ETH_ALEN);
|
||||
gmac[0] |= 0x01;
|
||||
mac = gmac;
|
||||
|
Loading…
Reference in New Issue
Block a user