mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix: Ensure auth_data and ap_addr are properly set before marking STA as authenticated
@ 2024-11-08  2:28 Saru2003
  2024-11-08  7:45 ` Johannes Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Saru2003 @ 2024-11-08  2:28 UTC (permalink / raw)
  To: johannes
  Cc: davem, edumazet, kuba, pabeni, linux-wireless, netdev,
	linux-kernel, Saru2003

Signed-off-by: Saru2003 <sarvesh20123@gmail.com>
---
 net/mac80211/mlme.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 735e78adb0db..a1ca7385dc1b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -4247,8 +4247,15 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata,
 static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata)
 {
 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
-	const u8 *ap_addr = ifmgd->auth_data->ap_addr;
+	const u8 *ap_addr;
 	struct sta_info *sta;
+	
+	if (!ifmgd->auth_data || !ifmgd->auth_data->ap_addr) {
+		sdata_info(sdata, "auth_data not set or ap_addr missing\n");
+		return false;
+	}
+
+	ap_addr = ifmgd->auth_data->ap_addr;
 
 	lockdep_assert_wiphy(sdata->local->hw.wiphy);
 
@@ -4261,7 +4268,7 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata)
 	/* move station state to auth */
 	sta = sta_info_get(sdata, ap_addr);
 	if (!sta) {
-		WARN_ONCE(1, "%s: STA %pM not found", sdata->name, ap_addr);
+	        sdata_info(sdata, "STA %pM not found, skipping authentication mark\n", ap_addr);
 		return false;
 	}
 	if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) {
-- 
2.43.0


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

end of thread, other threads:[~2024-11-08  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-08  2:28 [PATCH] Fix: Ensure auth_data and ap_addr are properly set before marking STA as authenticated Saru2003
2024-11-08  7:45 ` Johannes Berg
2024-11-08  9:10 ` kernel test robot
2024-11-08  9:10 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®