aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 581438255d7e..f149b4eb28d9 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -119,9 +119,10 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
119 } 119 }
120 } 120 }
121 121
122 ieee80211_key_link(key, sdata, sta); 122 err = ieee80211_key_link(key, sdata, sta);
123 if (err)
124 ieee80211_key_free(sdata->local, key);
123 125
124 err = 0;
125 out_unlock: 126 out_unlock:
126 mutex_unlock(&sdata->local->sta_mtx); 127 mutex_unlock(&sdata->local->sta_mtx);
127 128