linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix crash with WEP in ad-hoc mode
@ 2010-07-02 12:45 Felix Fietkau
  0 siblings, 0 replies; only message in thread
From: Felix Fietkau @ 2010-07-02 12:45 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Luis R. Rodriguez, Senthil Balasubramanian

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>
---
--- 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_comm
 			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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-02 12:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-02 12:45 [PATCH] ath9k: fix crash with WEP in ad-hoc mode Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).