]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mac80211: make link iteration safe for 'break'
authorJohannes Berg <johannes.berg@intel.com>
Wed, 5 Nov 2025 15:03:42 +0000 (16:03 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 10 Nov 2025 09:38:49 +0000 (10:38 +0100)
commit29cc798e7061e603843091af2f17b5b25009e7b8
treee38fad092696e755a2c909a32cd8b6f060bdd246
parent1a1cad924e8a60252132446fbba1284035010b4f
wifi: mac80211: make link iteration safe for 'break'

The current link iteration macros for_each_sdata_link() and
for_each_sdata_link_rcu() are various nested for loops, but
because they iterate all sdata instances and then all links
inside, using 'break' inside the iteration doesn't actually
break out of the whole iteration.

Make it work by tracking whether or not the inner iteration
(over links) actually completed, if it broke out then given
list_for_each_entry() it still iterates all sdata instances
but won't go into them.

Link: https://patch.msgid.link/20251105160431.c21956654fc0.I8d4739af061c44c57d172f19a15303a44ad1e596@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h