Commit 858fd188 authored by Johannes Berg's avatar Johannes Berg

wifi: nl80211: hold wdev mutex in add/mod/del link station

Since we deal with links, and that requires looking at wdev links,
we should hold the wdev mutex for driver convenience.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 21476ad1
...@@ -15781,9 +15781,14 @@ nl80211_add_mod_link_station(struct sk_buff *skb, struct genl_info *info, ...@@ -15781,9 +15781,14 @@ nl80211_add_mod_link_station(struct sk_buff *skb, struct genl_info *info,
if (err) if (err)
return err; return err;
wdev_lock(dev->ieee80211_ptr);
if (add) if (add)
return rdev_add_link_station(rdev, dev, &params); err = rdev_add_link_station(rdev, dev, &params);
return rdev_mod_link_station(rdev, dev, &params); else
err = rdev_mod_link_station(rdev, dev, &params);
wdev_unlock(dev->ieee80211_ptr);
return err;
} }
static int static int
...@@ -15804,6 +15809,7 @@ nl80211_remove_link_station(struct sk_buff *skb, struct genl_info *info) ...@@ -15804,6 +15809,7 @@ nl80211_remove_link_station(struct sk_buff *skb, struct genl_info *info)
struct link_station_del_parameters params = {}; struct link_station_del_parameters params = {};
struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct net_device *dev = info->user_ptr[1]; struct net_device *dev = info->user_ptr[1];
int ret;
if (!rdev->ops->del_link_station) if (!rdev->ops->del_link_station)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -15815,7 +15821,11 @@ nl80211_remove_link_station(struct sk_buff *skb, struct genl_info *info) ...@@ -15815,7 +15821,11 @@ nl80211_remove_link_station(struct sk_buff *skb, struct genl_info *info)
params.mld_mac = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); params.mld_mac = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]);
params.link_id = nla_get_u8(info->attrs[NL80211_ATTR_MLO_LINK_ID]); params.link_id = nla_get_u8(info->attrs[NL80211_ATTR_MLO_LINK_ID]);
return rdev_del_link_station(rdev, dev, &params); wdev_lock(dev->ieee80211_ptr);
ret = rdev_del_link_station(rdev, dev, &params);
wdev_unlock(dev->ieee80211_ptr);
return ret;
} }
#define NL80211_FLAG_NEED_WIPHY 0x01 #define NL80211_FLAG_NEED_WIPHY 0x01
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment