[PATCH] staging: rtl8723bs: return -ENOENT for AP/Ad-Hoc get_station

From: moradi.saeed

Date: Wed Dec 31 2025 - 02:23:52 EST


The cfg80211 get_station callback must return -ENOENT when
station information is unavailable. The AP/Ad-Hoc path
currently returns success without filling station_info,
leading to invalid data exposure to userspace.

Fix this by returning -ENOENT for unimplemented modes.

Signed-off-by: moradi.saeed <saeed.b.67@xxxxxxxxx>
---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 60edeae1cffe..c6562b8a59a6 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1011,7 +1011,9 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
check_fwstate(pmlmepriv, WIFI_AP_STATE)) &&
check_fwstate(pmlmepriv, _FW_LINKED)) {
- /* TODO: should acquire station info... */
+ ret = -ENOENT;
+ goto exit;
+
}

exit:
--
2.34.1