diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 0e3a1753a51c..8a0ea62d87c8 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -569,6 +569,10 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, /* KRACK protection, shouldn't happen but just silently accept key */ if (err == -EALREADY) err = 0; + else if (err < 0) { + printk("%d, %p, %s\n", err, key, __func__); + ieee80211_key_free_unused(key); + } out_unlock: mutex_unlock(&local->sta_mtx);