mac80211: fix memory leaks with element parsing
authorJohannes Berg <johannes.berg@intel.com>
Thu, 13 Oct 2022 18:16:00 +0000 (20:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Oct 2022 05:59:05 +0000 (07:59 +0200)
commit7d998f6b7365d50a9905bf57fd28b41c7ebe8e9d
tree95d3c67aadbf227658dce48841d86b324570486d
parentfee48f3bdd7516bb63da507213916227cf147211
mac80211: fix memory leaks with element parsing

commit 8223ac199a3849257e86ec27865dc63f034b1cf1 upstream.

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>
Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/agg-rx.c
net/mac80211/ibss.c
net/mac80211/mlme.c