diff mbox series

[wireless] wifi: mac80211: Fix a memory leak in ieee80211_key_link()

Message ID cd52eee26b2afd7823b58654d73ef631ad2930e3.1696140396.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [wireless] wifi: mac80211: Fix a memory leak in ieee80211_key_link() | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Christophe JAILLET Oct. 1, 2023, 6:08 a.m. UTC
Commit 5d6020ba6657 seems to be conflicting with d097ae01ebd4 and what
used to "goto out" now ends with a direct return.

Restore the expected behavior.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is here more to draw attention to something that looks wrong
because of a merge conflict.

If there is really an issue, then the commit description certainly need to
we improved, by someone that know the recent changes better than me.
---
 net/mac80211/key.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 2913c6b13558..af74d7f9d94d 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -910,8 +910,10 @@  int ieee80211_key_link(struct ieee80211_key *key,
 	 * Silently accept key re-installation without really installing the
 	 * new version of the key to avoid nonce reuse or replay issues.
 	 */
-	if (ieee80211_key_identical(sdata, old_key, key))
-		return -EALREADY;
+	if (ieee80211_key_identical(sdata, old_key, key)) {
+		ret = -EALREADY;
+		goto out;
+	}
 
 	key->local = sdata->local;
 	key->sdata = sdata;