summaryrefslogtreecommitdiff
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-04-03 14:45:54 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-04-11 16:23:51 -0400
commit4d6c36fa227afc7b76b85ee48e3ef3972fe0ca23 (patch)
tree4415934f1ea4b3ab0b2df135510640100437e71c /net/mac80211/iface.c
parent3a25a8c8b75b430c4f4022918e26fa51d557ecde (diff)
mac80211: clean up an ieee80211_do_open error path
Eliad's comment prompted me to look closer at the error paths in ieee80211_do_open() and I found one that should use the error labels. Also add a comment about the clear_bit since in many error cases the bit hasn't been set. Cc: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index ed297649c577..6e85faed053d 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -349,9 +349,8 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
if (!is_valid_ether_addr(dev->dev_addr)) {
- if (!local->open_count)
- drv_stop(local);
- return -EADDRNOTAVAIL;
+ res = -EADDRNOTAVAIL;
+ goto err_stop;
}
}
@@ -485,6 +484,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
sdata->bss = NULL;
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
list_del(&sdata->u.vlan.list);
+ /* might already be clear but that doesn't matter */
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
return res;
}