diff options
author | Johannes Berg <johannes.berg@intel.com> | 2022-07-06 10:57:42 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-07-15 12:43:18 +0300 |
commit | cdf0a0a80c841cfede6926d417a8756ea4c52d26 (patch) | |
tree | 9cf920c5168f72dbec96686a93da0cd5eef9bdc7 /net/wireless/nl80211.c | |
parent | a95fe067825526b10c8a165df2d77db1ddce42fa (diff) | |
download | linux-cdf0a0a80c841cfede6926d417a8756ea4c52d26.tar.xz |
wifi: cfg80211: clean up links appropriately
This was missing earlier, we need to remove links when
interfaces are being destroyed, and we also need to
stop (AP) operations when a link is being destroyed.
Address these issues to remove many warnings that will
otherwise appear in mac80211.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 11cad2d46d0e..d774e9a95492 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -4279,7 +4279,7 @@ static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info) mutex_lock(&rdev->wiphy.mtx); - return rdev_del_virtual_intf(rdev, wdev); + return cfg80211_remove_virtual_intf(rdev, wdev); } static int nl80211_set_noack_map(struct sk_buff *skb, struct genl_info *info) @@ -15707,7 +15707,6 @@ static int nl80211_add_link(struct sk_buff *skb, struct genl_info *info) static int nl80211_remove_link(struct sk_buff *skb, struct genl_info *info) { - struct cfg80211_registered_device *rdev = info->user_ptr[0]; unsigned int link_id = nl80211_link_id(info->attrs); struct net_device *dev = info->user_ptr[1]; struct wireless_dev *wdev = dev->ieee80211_ptr; @@ -15723,14 +15722,8 @@ static int nl80211_remove_link(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } - /* FIXME: stop the link operations first */ - wdev_lock(wdev); - wdev->valid_links &= ~BIT(link_id); - - rdev_del_intf_link(rdev, wdev, link_id); - - eth_zero_addr(wdev->links[link_id].addr); + cfg80211_remove_link(wdev, link_id); wdev_unlock(wdev); return 0; |