* @wiphy: pointer to hardware description
* @iftype: interface type
* @registered: is this wdev already registered with cfg80211
+ * @registering: indicates we're doing registration under wiphy lock
+ * for the notifier
* @list: (private) Used to collect the interfaces
* @netdev: (private) Used to reference back to the netdev, may be %NULL
* @identifier: (private) Identifier used in nl80211 to identify this
struct mutex mtx;
- bool use_4addr, is_running, registered;
+ bool use_4addr, is_running, registered, registering;
u8 address[ETH_ALEN] __aligned(sizeof(u16));
/* we'll take care of this */
wdev->registered = true;
+ wdev->registering = true;
ret = register_netdevice(dev);
if (ret)
goto out;
cfg80211_register_wdev(rdev, wdev);
ret = 0;
out:
+ wdev->registering = false;
if (ret)
wdev->registered = false;
return ret;
* It is possible to get NETDEV_UNREGISTER multiple times,
* so check wdev->registered.
*/
- if (wdev->registered) {
+ if (wdev->registered && !wdev->registering) {
wiphy_lock(&rdev->wiphy);
_cfg80211_unregister_wdev(wdev, false);
wiphy_unlock(&rdev->wiphy);