Skip to content

Commit a796dac

Browse files
Tomasz Bursztykalinvjw
authored andcommitted
wireless: core: Reorder wiphy_register() notifications relevantly
Currently it can send regulatory domain change notification before any NEW_WIPHY notification. Moreover, if rfill_register() fails, calling wiphy_unregister() will send a DEL_WIPHY though no NEW_WIPHY had been sent previously. Thus reordering so it properly notifies NEW_WIPHY before any other. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent f0bd88d commit a796dac

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎net/wireless/core.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,9 @@ int wiphy_register(struct wiphy *wiphy)
635635
if (IS_ERR(rdev->wiphy.debugfsdir))
636636
rdev->wiphy.debugfsdir = NULL;
637637

638+
cfg80211_debugfs_rdev_add(rdev);
639+
nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
640+
638641
if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
639642
struct regulatory_request request;
640643

@@ -646,8 +649,6 @@ int wiphy_register(struct wiphy *wiphy)
646649
nl80211_send_reg_change_event(&request);
647650
}
648651

649-
cfg80211_debugfs_rdev_add(rdev);
650-
651652
rdev->wiphy.registered = true;
652653
rtnl_unlock();
653654

@@ -659,8 +660,6 @@ int wiphy_register(struct wiphy *wiphy)
659660
return res;
660661
}
661662

662-
nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
663-
664663
return 0;
665664
}
666665
EXPORT_SYMBOL(wiphy_register);

0 commit comments

Comments
 (0)