]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/mac80211/cfg.c
mac80211: Fix key freeing to handle unlinked keys
[net-next-2.6.git] / net / mac80211 / cfg.c
index b769567949be506586809570c2d92827f5912b67..dab6b8efe5fa56e5ea11252e7fa192e5bbe79d05 100644 (file)
@@ -158,7 +158,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
        if (mac_addr) {
                sta = sta_info_get_bss(sdata, mac_addr);
                if (!sta) {
-                       ieee80211_key_free(key);
+                       ieee80211_key_free(sdata->local, key);
                        err = -ENOENT;
                        goto out_unlock;
                }
@@ -192,7 +192,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
                        goto out_unlock;
 
                if (sta->key) {
-                       ieee80211_key_free(sta->key);
+                       ieee80211_key_free(sdata->local, sta->key);
                        WARN_ON(sta->key);
                        ret = 0;
                }
@@ -205,7 +205,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
                goto out_unlock;
        }
 
-       ieee80211_key_free(sdata->keys[key_idx]);
+       ieee80211_key_free(sdata->local, sdata->keys[key_idx]);
        WARN_ON(sdata->keys[key_idx]);
 
        ret = 0;