wifi: cfg80211: fix regulatory disconnect for non-MLO
authorJohannes Berg <johannes.berg@intel.com>
Fri, 16 Jun 2023 20:28:44 +0000 (22:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:22:09 +0000 (16:22 +0200)
commit1a312d5a8c846bf0a1934759e7cb179aa6e5826f
tree99d95373630578893e7bf8b450c5f3de7a65b0d9
parent5b2b6586c5db61267f183907f7b6fba0c2b92f3e
wifi: cfg80211: fix regulatory disconnect for non-MLO

commit b22552fcaf1970360005c805d7fba4046cf2ab4a upstream.

The multi-link loop here broke disconnect when multi-link
operation (MLO) isn't active for a given interface, since
in that case valid_links is 0 (indicating no links, i.e.
no MLO.)

Fix this by taking that into account properly and skipping
the link only if there are valid_links in the first place.

Cc: stable@vger.kernel.org
Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20230616222844.eb073d650c75.I72739923ef80919889ea9b50de9e4ba4baa836ae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/reg.c