In ieee80211_latest_active_link_conn_timeout() we loop over all sta->links in order to compute the timeout expiring last across all links. Such timeout is stored in `latest_timeout` which is used in the time_after() comparison before having been initialized. Should the for-loop terminate without ever setting `latest_timeout` we would even return it in its uninitialized state. Fix this behaviour by initializing the variable to its minimum value 0. Address-Coverity-ID: 1647986 ("Uninitialized variables (UNINIT)") Fixes: 1bc892d76a6f ("wifi: mac80211: extend connection monitoring for MLO") Signed-off-by: Antonio Quartulli <antonio@xxxxxxxxxxxxx> --- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b4b7ea52c65e..0d96490510bf 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -8521,7 +8521,7 @@ static void ieee80211_sta_bcn_mon_timer(struct timer_list *t) static unsigned long ieee80211_latest_active_link_conn_timeout(struct ieee80211_sub_if_data *sdata) { - unsigned long latest_timeout; + unsigned long latest_timeout = 0; unsigned int link_id; struct sta_info *sta; -- 2.49.1