aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/ieee80211_ioctl.c')
-rw-r--r--net/mac80211/ieee80211_ioctl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 1d585cc2c8c7..10ec05624a67 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -73,11 +73,8 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
73 key = NULL; 73 key = NULL;
74 } else { 74 } else {
75 /* 75 /*
76 * Need to free it before allocating a new one with 76 * Automatically frees any old key if present.
77 * with the same index or the ordering to the driver's
78 * set_key() callback becomes confused.
79 */ 77 */
80 ieee80211_key_free(key);
81 key = ieee80211_key_alloc(sdata, sta, alg, idx, key_len, _key); 78 key = ieee80211_key_alloc(sdata, sta, alg, idx, key_len, _key);
82 if (!key) { 79 if (!key) {
83 ret = -ENOMEM; 80 ret = -ENOMEM;