diff options
author | David S. Miller <davem@davemloft.net> | 2015-01-15 19:28:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-15 19:28:36 -0500 |
commit | aaef66b837104e1b2901215de3f68fce9e60acc7 (patch) | |
tree | 11c52d3fda102c77e82a97c1b35ff185560af997 /net | |
parent | f7d855566ff69207be1052ceecbf455f89490b42 (diff) | |
parent | 20658702e08ecd693236b443837d28863b93e872 (diff) |
Merge tag 'mac80211-for-davem-2015-01-15' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Just two fixes - one for an uninialized variable and
one for a deadlock in regulatory processing.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mlme.c | 2 | ||||
-rw-r--r-- | net/wireless/reg.c | 56 |
2 files changed, 35 insertions, 23 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 2c36c4765f47..837a406a9dd6 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1643,7 +1643,7 @@ __ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata) | |||
1643 | { | 1643 | { |
1644 | struct ieee80211_local *local = sdata->local; | 1644 | struct ieee80211_local *local = sdata->local; |
1645 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 1645 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
1646 | bool ret; | 1646 | bool ret = false; |
1647 | int ac; | 1647 | int ac; |
1648 | 1648 | ||
1649 | if (local->hw.queues < IEEE80211_NUM_ACS) | 1649 | if (local->hw.queues < IEEE80211_NUM_ACS) |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 7b8309840d4e..d39d1cbc86b1 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1530,45 +1530,40 @@ static void reg_call_notifier(struct wiphy *wiphy, | |||
1530 | 1530 | ||
1531 | static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) | 1531 | static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) |
1532 | { | 1532 | { |
1533 | struct ieee80211_channel *ch; | ||
1534 | struct cfg80211_chan_def chandef; | 1533 | struct cfg80211_chan_def chandef; |
1535 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); | 1534 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
1536 | bool ret = true; | 1535 | enum nl80211_iftype iftype; |
1537 | 1536 | ||
1538 | wdev_lock(wdev); | 1537 | wdev_lock(wdev); |
1538 | iftype = wdev->iftype; | ||
1539 | 1539 | ||
1540 | /* make sure the interface is active */ | ||
1540 | if (!wdev->netdev || !netif_running(wdev->netdev)) | 1541 | if (!wdev->netdev || !netif_running(wdev->netdev)) |
1541 | goto out; | 1542 | goto wdev_inactive_unlock; |
1542 | 1543 | ||
1543 | switch (wdev->iftype) { | 1544 | switch (iftype) { |
1544 | case NL80211_IFTYPE_AP: | 1545 | case NL80211_IFTYPE_AP: |
1545 | case NL80211_IFTYPE_P2P_GO: | 1546 | case NL80211_IFTYPE_P2P_GO: |
1546 | if (!wdev->beacon_interval) | 1547 | if (!wdev->beacon_interval) |
1547 | goto out; | 1548 | goto wdev_inactive_unlock; |
1548 | 1549 | chandef = wdev->chandef; | |
1549 | ret = cfg80211_reg_can_beacon(wiphy, | ||
1550 | &wdev->chandef, wdev->iftype); | ||
1551 | break; | 1550 | break; |
1552 | case NL80211_IFTYPE_ADHOC: | 1551 | case NL80211_IFTYPE_ADHOC: |
1553 | if (!wdev->ssid_len) | 1552 | if (!wdev->ssid_len) |
1554 | goto out; | 1553 | goto wdev_inactive_unlock; |
1555 | 1554 | chandef = wdev->chandef; | |
1556 | ret = cfg80211_reg_can_beacon(wiphy, | ||
1557 | &wdev->chandef, wdev->iftype); | ||
1558 | break; | 1555 | break; |
1559 | case NL80211_IFTYPE_STATION: | 1556 | case NL80211_IFTYPE_STATION: |
1560 | case NL80211_IFTYPE_P2P_CLIENT: | 1557 | case NL80211_IFTYPE_P2P_CLIENT: |
1561 | if (!wdev->current_bss || | 1558 | if (!wdev->current_bss || |
1562 | !wdev->current_bss->pub.channel) | 1559 | !wdev->current_bss->pub.channel) |
1563 | goto out; | 1560 | goto wdev_inactive_unlock; |
1564 | 1561 | ||
1565 | ch = wdev->current_bss->pub.channel; | 1562 | if (!rdev->ops->get_channel || |
1566 | if (rdev->ops->get_channel && | 1563 | rdev_get_channel(rdev, wdev, &chandef)) |
1567 | !rdev_get_channel(rdev, wdev, &chandef)) | 1564 | cfg80211_chandef_create(&chandef, |
1568 | ret = cfg80211_chandef_usable(wiphy, &chandef, | 1565 | wdev->current_bss->pub.channel, |
1569 | IEEE80211_CHAN_DISABLED); | 1566 | NL80211_CHAN_NO_HT); |
1570 | else | ||
1571 | ret = !(ch->flags & IEEE80211_CHAN_DISABLED); | ||
1572 | break; | 1567 | break; |
1573 | case NL80211_IFTYPE_MONITOR: | 1568 | case NL80211_IFTYPE_MONITOR: |
1574 | case NL80211_IFTYPE_AP_VLAN: | 1569 | case NL80211_IFTYPE_AP_VLAN: |
@@ -1581,9 +1576,26 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
1581 | break; | 1576 | break; |
1582 | } | 1577 | } |
1583 | 1578 | ||
1584 | out: | ||
1585 | wdev_unlock(wdev); | 1579 | wdev_unlock(wdev); |
1586 | return ret; | 1580 | |
1581 | switch (iftype) { | ||
1582 | case NL80211_IFTYPE_AP: | ||
1583 | case NL80211_IFTYPE_P2P_GO: | ||
1584 | case NL80211_IFTYPE_ADHOC: | ||
1585 | return cfg80211_reg_can_beacon(wiphy, &chandef, iftype); | ||
1586 | case NL80211_IFTYPE_STATION: | ||
1587 | case NL80211_IFTYPE_P2P_CLIENT: | ||
1588 | return cfg80211_chandef_usable(wiphy, &chandef, | ||
1589 | IEEE80211_CHAN_DISABLED); | ||
1590 | default: | ||
1591 | break; | ||
1592 | } | ||
1593 | |||
1594 | return true; | ||
1595 | |||
1596 | wdev_inactive_unlock: | ||
1597 | wdev_unlock(wdev); | ||
1598 | return true; | ||
1587 | } | 1599 | } |
1588 | 1600 | ||
1589 | static void reg_leave_invalid_chans(struct wiphy *wiphy) | 1601 | static void reg_leave_invalid_chans(struct wiphy *wiphy) |