summaryrefslogtreecommitdiff
path: root/net/mac80211/agg-rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2021-10-01 22:11:08 +0300
committerJohannes Berg <johannes.berg@intel.com>2021-10-21 17:54:04 +0300
commit8223ac199a3849257e86ec27865dc63f034b1cf1 (patch)
treee7e391484c4dbe8592e4c8da300442f4a8ec5be1 /net/mac80211/agg-rx.c
parent10de5a599f92ef776886073a33ca7bbbe6b14d37 (diff)
downloadlinux-8223ac199a3849257e86ec27865dc63f034b1cf1.tar.xz
mac80211: fix memory leaks with element parsing
My previous commit 5d24828d05f3 ("mac80211: always allocate struct ieee802_11_elems") had a few bugs and leaked the new allocated struct in a few error cases, fix that. Fixes: 5d24828d05f3 ("mac80211: always allocate struct ieee802_11_elems") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://lore.kernel.org/r/20211001211108.9839928e42e0.Ib81ca187d3d3af7ed1bfeac2e00d08a4637c8025@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/agg-rx.c')
-rw-r--r--net/mac80211/agg-rx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 94c65def102c..470ff0ce3dc7 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -498,13 +498,14 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
elems = ieee802_11_parse_elems(mgmt->u.action.u.addba_req.variable,
ies_len, true, mgmt->bssid, NULL);
if (!elems || elems->parse_error)
- return;
+ goto free;
}
__ieee80211_start_rx_ba_session(sta, dialog_token, timeout,
start_seq_num, ba_policy, tid,
buf_size, true, false,
elems ? elems->addba_ext_ie : NULL);
+free:
kfree(elems);
}