linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw89: check if sta's mac_id is valid under AP/TDLS
@ 2022-10-21  9:18 Ping-Ke Shih
  2022-11-01  9:25 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Ping-Ke Shih @ 2022-10-21  9:18 UTC (permalink / raw)
  To: kvalo; +Cc: kevin_yang, linux-wireless

From: Zong-Zhe Yang <kevin_yang@realtek.com>

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>
---
 drivers/net/wireless/realtek/rtw89/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index a0fa9639b5097..557a4dcde1e7d 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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: rtw89: check if sta's mac_id is valid under AP/TDLS
  2022-10-21  9:18 [PATCH] wifi: rtw89: check if sta's mac_id is valid under AP/TDLS Ping-Ke Shih
@ 2022-11-01  9:25 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-11-01  9:25 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: kevin_yang, linux-wireless

Ping-Ke Shih <pkshih@realtek.com> wrote:

> From: Zong-Zhe Yang <kevin_yang@realtek.com>
> 
> 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>

Patch applied to wireless-next.git, thanks.

46245bc42aff wifi: rtw89: check if sta's mac_id is valid under AP/TDLS

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20221021091828.40157-1-pkshih@realtek.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-01  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-21  9:18 [PATCH] wifi: rtw89: check if sta's mac_id is valid under AP/TDLS Ping-Ke Shih
2022-11-01  9:25 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).