This addresses some things Michael Wu noticed. Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> --- net/mac80211/key.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) --- wireless-dev.orig/net/mac80211/key.c 2007-08-28 17:52:43.204622115 +0200 +++ wireless-dev/net/mac80211/key.c 2007-08-28 17:53:19.634622115 +0200 @@ -181,14 +181,17 @@ struct ieee80211_key *ieee80211_key_allo if (sta->flags & WLAN_STA_WME) key->conf.flags |= IEEE80211_KEY_FLAG_WMM_STA; } else { - struct sta_info *ap; + if (sdata->type == IEEE80211_IF_TYPE_STA) { + struct sta_info *ap; - /* same here, the AP could be using QoS */ - ap = sta_info_get(key->local, key->sdata->u.sta.bssid); - if (ap) { - if (ap->flags & WLAN_STA_WME) - key->conf.flags |= IEEE80211_KEY_FLAG_WMM_STA; - sta_info_put(ap); + /* same here, the AP could be using QoS */ + ap = sta_info_get(key->local, key->sdata->u.sta.bssid); + if (ap) { + if (ap->flags & WLAN_STA_WME) + key->conf.flags |= + IEEE80211_KEY_FLAG_WMM_STA; + sta_info_put(ap); + } } if (idx >= 0 && idx < NUM_DEFAULT_KEYS) { @@ -200,7 +203,9 @@ struct ieee80211_key *ieee80211_key_allo WARN_ON(1); } + mutex_lock(&sdata->key_mtx); list_add(&key->list, &sdata->key_list); + mutex_unlock(&sdata->key_mtx); if (netif_running(key->sdata->dev)) ieee80211_key_enable_hw_accel(key); -- - To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html