]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: fix memory leak in ieee80211_mgd_assoc_ml_reconf()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 15 Jan 2025 06:54:52 +0000 (09:54 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 15 Jan 2025 13:39:32 +0000 (14:39 +0100)
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@linaro.org>
Link: https://patch.msgid.link/7ad826a7-7651-48e7-9589-7d2dc17417c2@stanley.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c

index 0d3f64eb573e3dc02f9c3e7e1a426a9d0db59862..f8d52b3b0d0e4cf1beefc7e0ca8de385d68d2c36 100644 (file)
@@ -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;