On 1/28/2024 9:28 PM, Aditya Kumar Singh wrote: > diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c > index 68a48abc7287..504db497df06 100644 > --- a/net/mac80211/tx.c > +++ b/net/mac80211/tx.c > @@ -5030,16 +5030,24 @@ static u8 __ieee80211_beacon_update_cntdwn(struct beacon_data *beacon) > return beacon->cntdwn_current_counter; > } > > -u8 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif) > +u8 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif, unsigned int link_id) > { > struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); > + struct ieee80211_link_data *link; > struct beacon_data *beacon = NULL; > u8 count = 0; > > + if (WARN_ON(link_id > IEEE80211_MLD_MAX_NUM_LINKS)) shouldn't this be >= ? aren't the arrays size [IEEE80211_MLD_MAX_NUM_LINKS] and hence indexes must be 0..IEEE80211_MLD_MAX_NUM_LINKS-1? > + return 0; > + > rcu_read_lock(); > > + link = rcu_dereference(sdata->link[link_id]); > + if (!link) > + goto unlock; > + > if (sdata->vif.type == NL80211_IFTYPE_AP) > - beacon = rcu_dereference(sdata->deflink.u.ap.beacon); > + beacon = rcu_dereference(link->u.ap.beacon); > else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) > beacon = rcu_dereference(sdata->u.ibss.presp); > else if (ieee80211_vif_is_mesh(&sdata->vif))