diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c index 16e2849f644d89682bc2c648e19f8930d113d67b..c86f7d3593ab48a3c1c1248443f0f2f599a327f8 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, 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;