[<prev] [next>] [day] [month] [year] [list]
Message-ID: <7ad826a7-7651-48e7-9589-7d2dc17417c2@stanley.mountain>
Date: Wed, 15 Jan 2025 09:54:52 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Ilan Peer <ilan.peer@...el.com>
Cc: Johannes Berg <johannes@...solutions.net>,
Miri Korenblit <miriam.rachel.korenblit@...el.com>,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH next] wifi: mac80211: fix memory leak in
ieee80211_mgd_assoc_ml_reconf()
Free the "data" allocation before returning on this error path.
Fixes: 36e05b0b8390 ("wifi: mac80211: Support dynamic link addition and removal")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
net/mac80211/mlme.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0d3f64eb573e..f8d52b3b0d0e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -10273,8 +10273,10 @@ int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata,
* on which the request was received.
*/
skb = ieee80211_build_ml_reconf_req(sdata, data, rem_links);
- if (!skb)
- return -ENOMEM;
+ if (!skb) {
+ err = -ENOMEM;
+ goto err_free;
+ }
if (rem_links) {
u16 new_dormant_links = sdata->vif.dormant_links & ~rem_links;
--
2.45.2
Powered by blists - more mailing lists