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 --- 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