wifi: mac80211: don't re-add debugfs during reconfig
authorJohannes Berg <johannes.berg@intel.com>
Mon, 11 Dec 2023 07:05:19 +0000 (09:05 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 12 Dec 2023 09:14:57 +0000 (10:14 +0100)
If we're doing reconfig, then we cannot add the debugfs
files that are already there from before the reconfig.
Skip that in drv_change_sta_links() during reconfig.

Fixes: d2caad527c19 ("wifi: mac80211: add API to show the link STAs in debugfs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231211085121.88a950f43e16.Id71181780994649219685887c0fcad33d387cc78@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/driver-ops.c

index 7938ec87ef25be234a2e6ca39da84fa37b33b93b..d3820333cd59c88b818642d81bc80dec0ee14f28 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright 2015 Intel Deutschland GmbH
- * Copyright (C) 2022 Intel Corporation
+ * Copyright (C) 2022-2023 Intel Corporation
  */
 #include <net/mac80211.h>
 #include "ieee80211_i.h"
@@ -589,6 +589,10 @@ int drv_change_sta_links(struct ieee80211_local *local,
        if (ret)
                return ret;
 
+       /* during reconfig don't add it to debugfs again */
+       if (local->in_reconfig)
+               return 0;
+
        for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) {
                link_sta = rcu_dereference_protected(info->link[link_id],
                                                     lockdep_is_held(&local->hw.wiphy->mtx));