From: Johannes Berg <johannes@sipsolutions.net>
To: Antonio Quartulli <antonio@mandelbit.com>,
linux-wireless@vger.kernel.org
Cc: Maharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
Subject: Re: [PATCH] wifi: mac80211: fix unassigned variable access
Date: Tue, 22 Jul 2025 10:54:06 +0200 [thread overview]
Message-ID: <cdfcd722e1f8527809d89e13484bcb25d3e74947.camel@sipsolutions.net> (raw)
In-Reply-To: <20250721211736.29269-1-antonio@mandelbit.com>
On Mon, 2025-07-21 at 23:17 +0200, Antonio Quartulli wrote:
> 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.
It's really not plausible to have no links at all though.
So I think if anything we should worry about the
if (time_is_after_jiffies(timeout) &&
time_after(timeout, latest_timeout))
latest_timeout = timeout;
comparison, but for that just unconditionally setting it to 0 is really
the wrong thing to do, since it means you compare to an arbitrary time
zero here?
johannes
next prev parent reply other threads:[~2025-07-22 8:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 21:17 [PATCH] wifi: mac80211: fix unassigned variable access Antonio Quartulli
2025-07-22 8:54 ` Johannes Berg [this message]
2025-07-22 9:00 ` Antonio Quartulli
2025-07-22 9:02 ` Johannes Berg
2025-07-22 9:34 ` Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cdfcd722e1f8527809d89e13484bcb25d3e74947.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=antonio@mandelbit.com \
--cc=linux-wireless@vger.kernel.org \
--cc=maharaja.kennadyrajan@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).