Skip to contentSkip to conversation

net: wireless: remove WARN_ON() in cfg80211_sme_connect

PATCH New Du Cheng 1 participant 1 message Apr 7, 2021 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Du Cheng

author
#0 lore raw

PATCH v2 1/1 net: wireless: remove WARN_ON() in cfg80211_sme_connect

A WARN_ON(wdev->conn) would trigger in cfg80211_sme_connect(), if multiple send_msg(NL80211_CMD_CONNECT) system calls are made from the userland, which should be anticipated and handled by the wireless driver. Remove this WARN_ON() to prevent kernel panic if kernel is configured to "panic_on_warn".

Bug reported by syzbot.

---
change log
v1: convert WARN_ON() to pr_warn()
https://lore.kernel.org/linux-wireless/YG3bYPSB7Guv%2FKEe@carbon/T/#t
v2: just drop the WARN_ON()

 net/wireless/sme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/sme.c +1 -1
index 07756ca5e3b5..08a70b4f090c 100644
@@ -529,7 +529,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev,
 		cfg80211_sme_free(wdev);
 	}
 
-	if (WARN_ON(wdev->conn))
+	if (wdev->conn)
 		return -EINPROGRESS;
 
 	wdev->conn = kzalloc(sizeof(*wdev->conn), GFP_KERNEL);
Signature · 1 line
2.30.2