wifi: mac80211: initialize result for empty NAN function list
PATCH 1/1 wifi: mac80211: initialize result for empty NAN function list
ieee80211_reconfig_nan_offload_de() may be called with no registered NAN functions. In this case, the restoration loop is skipped and res is returned without being initialized.
Initialize res to zero so that reconfiguration succeeds when there are no NAN functions to restore.
This also fixes the uninitialized variable warning from Smatch.
Signed-off-by Artemii Mashanov <[email protected]>
--- net/mac80211/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/util.c +1 -1
@@ -1772,7 +1772,7 @@ static int ieee80211_reconfig_nan_offload_de(struct ieee80211_sub_if_data *sdata) {struct cfg80211_nan_func *func, **funcs; -int res, id, i =0 ; +int res =0 , id, i =0 ; funcs =kzalloc_objs (*funcs, sdata->local->hw.max_nan_de_entries +1 );if (!funcs)
Signature · 1 line
2.56.0