Skip to contentSkip to conversation

mac80211: unlock on error path in ieee80211_ibss_join()

PATCH In review Dan Carpenter 2 participants 2 messages Dec 8, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: unlock on error path in ieee80211_ibss_join()

We recently introduced a new return here but it needs an unlock first.

net/mac80211/ibss.c +3 -1
index 3f830ac..0fc9752 100644
@@ -993,8 +993,10 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
 	if (params->channel_fixed) {
 		sdata->local->oper_channel = params->channel;
 		if (!ieee80211_set_channel_type(sdata->local, sdata,
-					       params->channel_type))
+					       params->channel_type)) {
+			mutex_unlock(&sdata->u.ibss.mtx);
 			return -EINVAL;
+		}
 	}
 
 	if (params->ie) {
maintainer
#1 lore raw
Quoted 1 line · Dan Carpenter

We recently introduced a new return here but it needs an unlock first.

Thanks Dan! Bad Alex :-)

Quoted 19 lines
net/mac80211/ibss.c +3 -1
index 3f830ac..0fc9752 100644
@@ -993,8 +993,10 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
 	if (params->channel_fixed) {
 		sdata->local->oper_channel = params->channel;
 		if (!ieee80211_set_channel_type(sdata->local, sdata,
-					       params->channel_type))
+					       params->channel_type)) {
+			mutex_unlock(&sdata->u.ibss.mtx);
 			return -EINVAL;
+		}
 	}
 
 	if (params->ie) {