diff options
author | Zong-Zhe Yang <kevin_yang@realtek.com> | 2022-10-21 12:18:28 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-11-01 12:25:49 +0300 |
commit | 46245bc42aff5e67b0498fa365a4baeaaaaeda86 (patch) | |
tree | a30a7b3ea57aa654cb95de583585b1d2d4735b19 /drivers | |
parent | 25f49617b5c9c9afa829030f14606be6351d4771 (diff) | |
download | linux-46245bc42aff5e67b0498fa365a4baeaaaaeda86.tar.xz |
wifi: rtw89: check if sta's mac_id is valid under AP/TDLS
Add boundary check of mac_id when adding sta under AP/TDLS.
And, return -ENOSPC if the acquired mac_id is invalid.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221021091828.40157-1-pkshih@realtek.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/realtek/rtw89/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 6d8243ee184c..a27ca62274cc 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -2413,6 +2413,8 @@ int rtw89_core_sta_add(struct rtw89_dev *rtwdev, } else if (vif->type == NL80211_IFTYPE_AP || sta->tdls) { rtwsta->mac_id = rtw89_core_acquire_bit_map(rtwdev->mac_id_map, RTW89_MAX_MAC_ID_NUM); + if (rtwsta->mac_id == RTW89_MAX_MAC_ID_NUM) + return -ENOSPC; } return 0; |