Commit 4d6c36fa authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3a25a8c8
...@@ -349,9 +349,8 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) ...@@ -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); memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
if (!is_valid_ether_addr(dev->dev_addr)) { if (!is_valid_ether_addr(dev->dev_addr)) {
if (!local->open_count) res = -EADDRNOTAVAIL;
drv_stop(local); goto err_stop;
return -EADDRNOTAVAIL;
} }
} }
...@@ -485,6 +484,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) ...@@ -485,6 +484,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
sdata->bss = NULL; sdata->bss = NULL;
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
list_del(&sdata->u.vlan.list); list_del(&sdata->u.vlan.list);
/* might already be clear but that doesn't matter */
clear_bit(SDATA_STATE_RUNNING, &sdata->state); clear_bit(SDATA_STATE_RUNNING, &sdata->state);
return res; return res;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment