diff mbox series

[v2] net: wireless: remove WARN_ON() in cfg80211_sme_connect

Message ID 20210407162756.6101-1-ducheng2@gmail.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series [v2] net: wireless: remove WARN_ON() in cfg80211_sme_connect | expand

Commit Message

Du Cheng April 7, 2021, 4:27 p.m. UTC
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.

Reported-by: syzbot+5f9392825de654244975@syzkaller.appspotmail.com
Signed-off-by: Du Cheng <ducheng2@gmail.com>
---
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(-)
diff mbox series

Patch

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 07756ca5e3b5..08a70b4f090c 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -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);