diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-07-02 08:45:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-02 13:44:38 -0400 |
commit | 8e67ca7c9266a4f920d70d3a2cbf03a597d28ea7 (patch) | |
tree | 10c44b13c677caefa9f85b8dff4c85a800782c91 /drivers | |
parent | 347809fc2c99da5b89f1c014f3e5a0f85c04803c (diff) |
ath9k: fix crash with WEP in ad-hoc mode
Commit eed8e22f0133e8278b1f8079fcb452f1f9692f9d 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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c index 16e2849f644d..c86f7d3593ab 100644 --- a/drivers/net/wireless/ath/ath9k/common.c +++ b/drivers/net/wireless/ath/ath9k/common.c | |||
@@ -319,6 +319,10 @@ int ath9k_cmn_key_config(struct ath_common *common, | |||
319 | idx = ath_reserve_key_cache_slot(common, key->alg); | 319 | idx = ath_reserve_key_cache_slot(common, key->alg); |
320 | break; | 320 | break; |
321 | case NL80211_IFTYPE_ADHOC: | 321 | case NL80211_IFTYPE_ADHOC: |
322 | if (!sta) { | ||
323 | idx = key->keyidx; | ||
324 | break; | ||
325 | } | ||
322 | memcpy(gmac, sta->addr, ETH_ALEN); | 326 | memcpy(gmac, sta->addr, ETH_ALEN); |
323 | gmac[0] |= 0x01; | 327 | gmac[0] |= 0x01; |
324 | mac = gmac; | 328 | mac = gmac; |