Patchwork [3.5.y.z,extended,stable] Patch "mac80211: deinitialize ibss-internals after emptiness check" has been added to staging queue

mail settings
Submitter Herton Ronaldo Krzesinski
Date Dec. 10, 2012, 2:18 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/204888/
State New
Headers show


Herton Ronaldo Krzesinski - Dec. 10, 2012, 2:18 p.m.
This is a note to let you know that I have just added a patch titled

    mac80211: deinitialize ibss-internals after emptiness check

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From fa2939cbe519d96adef0848166fe1b548b23f6ed Mon Sep 17 00:00:00 2001
From: Simon Wunderlich <>
Date: Tue, 13 Nov 2012 18:43:03 +0100
Subject: [PATCH] mac80211: deinitialize ibss-internals after emptiness check

commit b78a4932f5fb11fadf41e69c606a33fa6787574c upstream.

The check whether the IBSS is active and can be removed should be
performed before deinitializing the fields used for the check/search.
Otherwise, the configured BSS will not be found and removed properly.

To make it more clear for the future, rename sdata->u.ibss to the
local pointer ifibss which is used within the checks.

This behaviour was introduced by
("mac80211: fix IBSS teardown race")

Cc: Ignacy Gawedzki <>
Signed-off-by: Simon Wunderlich <>
Signed-off-by: Johannes Berg <>
Signed-off-by: Herton Ronaldo Krzesinski <>
 net/mac80211/ibss.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)



diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index ebf6425..980b4f4 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1154,10 +1154,6 @@  int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)


-	sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
-	memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
-	sdata->u.ibss.ssid_len = 0;
 	active_ibss = ieee80211_sta_active_ibss(sdata);

 	if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
@@ -1178,6 +1174,10 @@  int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)

+	ifibss->state = IEEE80211_IBSS_MLME_SEARCH;
+	memset(ifibss->bssid, 0, ETH_ALEN);
+	ifibss->ssid_len = 0;
 	sta_info_flush(sdata->local, sdata);