Merge branch 'for-2637/i2c-all' of git://git.fluff.org/bjdooks/linux
[pandora-kernel.git] / net / mac80211 / sta_info.c
index ca2cba9..6d8f897 100644 (file)
@@ -616,7 +616,7 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
        struct ieee80211_sub_if_data *sdata;
        struct sk_buff *skb;
        unsigned long flags;
-       int ret;
+       int ret, i;
 
        might_sleep();
 
@@ -633,7 +633,7 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
         * will be sufficient.
         */
        set_sta_flags(sta, WLAN_STA_BLOCK_BA);
-       ieee80211_sta_tear_down_BA_sessions(sta);
+       ieee80211_sta_tear_down_BA_sessions(sta, true);
 
        spin_lock_irqsave(&local->sta_lock, flags);
        ret = sta_info_hash_del(local, sta);
@@ -644,10 +644,10 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
        if (ret)
                return ret;
 
-       if (sta->key) {
-               ieee80211_key_free(local, sta->key);
-               WARN_ON(sta->key);
-       }
+       for (i = 0; i < NUM_DEFAULT_KEYS; i++)
+               ieee80211_key_free(local, sta->gtk[i]);
+       if (sta->ptk)
+               ieee80211_key_free(local, sta->ptk);
 
        sta->dead = true;