wifi: mac80211: fix memory leak in ieee80211_mgd_assoc_ml_reconf()

Free the "data" allocation before returning on this error path.

Fixes: 36e05b0b83 ("wifi: mac80211: Support dynamic link addition and removal")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/7ad826a7-7651-48e7-9589-7d2dc17417c2@stanley.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Dan Carpenter 2025-01-15 09:54:52 +03:00 committed by Johannes Berg
parent 295adaf455
commit a4058dc1e7

View File

@ -10273,8 +10273,10 @@ int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata,
* on which the request was received. * on which the request was received.
*/ */
skb = ieee80211_build_ml_reconf_req(sdata, data, rem_links); skb = ieee80211_build_ml_reconf_req(sdata, data, rem_links);
if (!skb) if (!skb) {
return -ENOMEM; err = -ENOMEM;
goto err_free;
}
if (rem_links) { if (rem_links) {
u16 new_dormant_links = sdata->vif.dormant_links & ~rem_links; u16 new_dormant_links = sdata->vif.dormant_links & ~rem_links;