Re: [PATCH 6.6.y] wifi: cfg80211: release locks on error in cfg80211_wext_siwgenie()

From: Harshit Mogalapalli

Date: Mon Oct 12 2026 - 10:14:31 EST


Hi Wentao,

On 10/10/26 10:04 am, Wentao Guan wrote:
Sorry, it is for v6.6.158. cc the stable list.


this needs to be fixed on 5.15.y and 6.1.y.

This was reported here: https://lore.kernel.org/all/93db0eae-f479-4343-a126-59987ae0dc22@xxxxxxxxxx/

thanks for making a patch.

Are you planning to send it to other branches as well ?

thanks,
Harshit> BRs
Wentao Guan

---
net/wireless/wext-sme.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index cfa903eb0e82f..0e7c314bdeef0 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -354,8 +354,10 @@ int cfg80211_wext_siwgenie(struct net_device *dev,
/* nothing */
}
- if (!for_each_element_completed(elem, extra, ie_len))
- return -EINVAL;
+ if (!for_each_element_completed(elem, extra, ie_len)) {
+ err = -EINVAL;
+ goto out;
+ }

ie = kmemdup(extra, ie_len, GFP_KERNEL);
if (!ie) {