From: Ian Rogers <irogers@google.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Elkin Cruz <elkin@google.com>,
Ian Rogers <irogers@google.com>
Subject: [PATCH 1/2] wifi: mac80211: Return 0 from ieee80211_reconfig_nan_offload_de()
Date: Thu, 19 Nov 2026 09:09:10 -0800 [thread overview]
Message-ID: <97716b88b986cdfd77a6d90cd4c159a79f96b9bd.1795106967.git.irogers@google.com> (raw)
In-Reply-To: <cover.1795106967.git.irogers@google.com>
Commit 589c06e8fdee ("wifi: mac80211: add NAN local schedule support")
factored ieee80211_reconfig_nan_offload_de() out of
ieee80211_reconfig_nan() and added 'return res;' at the end without
initializing res.
When an active NAN interface with offloaded Discovery Engine has no
registered NAN functions in function_inst_ids, the drv_add_nan_func()
loop executes zero iterations and returns uninitialized stack memory
to ieee80211_reconfig_nan(), triggering spurious WARN_ON()s and
reconfig failures during hardware restart or resume. Moreover,
per-function drv_add_nan_func() errors are already handled inside the
loop via ieee80211_nan_func_terminated().
Return 0 after processing the NAN function array, restoring the
pre-589c06e8fdee behavior.
Found via Clang -Wconditional-uninitialized on an x86_64 allyesconfig
build. Verified by building net/mac80211/util.o with LLVM=1 W=1
(-Werror) and -Wconditional-uninitialized; not runtime-tested on NAN
hardware.
Fixes: 589c06e8fdee ("wifi: mac80211: add NAN local schedule support")
Signed-off-by: Ian Rogers <irogers@google.com>
---
net/mac80211/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 44feb80274c6..9fda135dc112 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1800,7 +1800,7 @@ ieee80211_reconfig_nan_offload_de(struct ieee80211_sub_if_data *sdata)
}
kfree(funcs);
- return res;
+ return 0;
}
static int ieee80211_reconfig_nan(struct ieee80211_sub_if_data *sdata)
--
2.56.1.708.g77570a6a1d-goog
next prev parent reply other threads:[~2026-11-19 17:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 17:09 [PATCH 0/2] wifi: mac80211: Two return-value fixes from Clang warning audit Ian Rogers
2026-11-19 17:09 ` Ian Rogers [this message]
2026-11-19 17:09 ` [PATCH 2/2] wifi: mac80211: Return NEG_TTLM_RES_REJECT when sdata is not in driver Ian Rogers
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=97716b88b986cdfd77a6d90cd4c159a79f96b9bd.1795106967.git.irogers@google.com \
--to=irogers@google.com \
--cc=elkin@google.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=llvm@lists.linux.dev \
/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