mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
wifi: mac80211: more station handling sanity checks
Add more sanity checks to the API handling, we shouldn't be able to create a station without links, nor should we be able to add a link to a station that wasn't created as an MLD with links in the first place. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
0ad49045f2
commit
956b961337
@ -4649,6 +4649,9 @@ static int sta_add_link_station(struct ieee80211_local *local,
|
||||
if (!sta)
|
||||
return -ENOENT;
|
||||
|
||||
if (!sta->sta.valid_links)
|
||||
return -EINVAL;
|
||||
|
||||
if (sta->sta.valid_links & BIT(params->link_id))
|
||||
return -EALREADY;
|
||||
|
||||
@ -4724,6 +4727,10 @@ static int sta_del_link_station(struct ieee80211_sub_if_data *sdata,
|
||||
if (!(sta->sta.valid_links & BIT(params->link_id)))
|
||||
return -EINVAL;
|
||||
|
||||
/* must not create a STA without links */
|
||||
if (sta->sta.valid_links == BIT(params->link_id))
|
||||
return -EINVAL;
|
||||
|
||||
ieee80211_sta_remove_link(sta, params->link_id);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user