Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: cfg80211: Fix an error handling path in cfg80211_wext_siwscan()
@ 2026-06-20 19:48 Christophe JAILLET
  2026-06-22  5:25 ` XIAO WU
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2026-06-20 19:48 UTC (permalink / raw)
  To: Johannes Berg, John W. Linville
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-wireless

If the test against IEEE80211_MAX_SSID_LEN fails, then 'creq' leaks.
Use the existing error handling path to fix it.

Fixes: 2a5193119269 ("cfg80211/nl80211: scanning (and mac80211 update to use it)")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only
---
 net/wireless/scan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 05b7dc6b766c..38001684014d 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -3612,8 +3612,10 @@ int cfg80211_wext_siwscan(struct net_device *dev,
 	/* translate "Scan for SSID" request */
 	if (wreq) {
 		if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
-			if (wreq->essid_len > IEEE80211_MAX_SSID_LEN)
-				return -EINVAL;
+			if (wreq->essid_len > IEEE80211_MAX_SSID_LEN) {
+				err = -EINVAL;
+				goto out;
+			}
 			memcpy(creq->req.ssids[0].ssid, wreq->essid,
 			       wreq->essid_len);
 			creq->req.ssids[0].ssid_len = wreq->essid_len;
-- 
2.54.0


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

end of thread, other threads:[~2026-06-27 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-20 19:48 [PATCH] wifi: cfg80211: Fix an error handling path in cfg80211_wext_siwscan() Christophe JAILLET
2026-06-22  5:25 ` XIAO WU
2026-06-27 11:45   ` Markus Elfring

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