git: eef52bbe9cb4 - stable/14 - LinuxKPI: 802.11: fix for_each_sta_active_link()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 12 Jun 2024 16:41:21 UTC
The branch stable/14 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=eef52bbe9cb44616116fab65f9bbf16d1e2d43ef

commit eef52bbe9cb44616116fab65f9bbf16d1e2d43ef
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-05-21 21:58:47 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-06-12 13:58:30 +0000

    LinuxKPI: 802.11: fix for_each_sta_active_link()
    
    Likely a c&p error from for_each_vif_active_link() to
    for_each_sta_active_link().
    We are checking the nitems on the vif instead of the sta in this macro.
    Function wise there is no difference as the arrays are the same size
    but for correctness fix this.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 69b6c4a6ec6654978628ccd48edce46f00ac3e96)
---
 sys/compat/linuxkpi/common/include/net/mac80211.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index fc9d7829dae3..6a477ae5c32a 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -1253,7 +1253,7 @@ ieee80211_hw_restart_disconnect(struct ieee80211_vif *vif)
 	    (_link = rcu_dereference((_vif)->link_conf[_linkid])) )
 
 #define	for_each_sta_active_link(_vif, _sta, _linksta, _linkid)		\
-    for (_linkid = 0; _linkid < nitems((_vif)->link_conf); _linkid++)	\
+    for (_linkid = 0; _linkid < nitems((_sta)->link); _linkid++)	\
 	if ( ((_vif)->active_links == 0 /* no MLO */ ||			\
 	    ((_vif)->active_links & BIT(_linkid)) != 0) &&		\
 	    (_linksta = link_sta_dereference_protected((_sta), (_linkid))) )