Skip to content

Commit 41f9ba6

Browse files
committed
Merge tag 'mac80211-for-davem-2018-06-15' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says: ==================== A handful of fixes: * missing RCU grace period enforcement led to drivers freeing data structures before; fix from Dedy Lansky. * hwsim module init error paths were messed up; fixed it myself after a report from Colin King (who had sent a partial patch) * kernel-doc tag errors; fix from Luca Coelho * initialize the on-stack sinfo data structure when getting station information; fix from Sven Eckelmann * TXQ state dumping is now done from init, and when TXQs aren't initialized yet at that point, bad things happen, move the initialization; fix from Toke Høiland-Jørgensen. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents ab188e8 + bf2b61a commit 41f9ba6

File tree

5 files changed

+32
-22
lines changed

5 files changed

+32
-22
lines changed

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3572,11 +3572,14 @@ static int __init init_mac80211_hwsim(void)
35723572
hwsim_wq = alloc_workqueue("hwsim_wq", 0, 0);
35733573
if (!hwsim_wq)
35743574
return -ENOMEM;
3575-
rhashtable_init(&hwsim_radios_rht, &hwsim_rht_params);
3575+
3576+
err = rhashtable_init(&hwsim_radios_rht, &hwsim_rht_params);
3577+
if (err)
3578+
goto out_free_wq;
35763579

35773580
err = register_pernet_device(&hwsim_net_ops);
35783581
if (err)
3579-
return err;
3582+
goto out_free_rht;
35803583

35813584
err = platform_driver_register(&mac80211_hwsim_driver);
35823585
if (err)
@@ -3701,6 +3704,10 @@ static int __init init_mac80211_hwsim(void)
37013704
platform_driver_unregister(&mac80211_hwsim_driver);
37023705
out_unregister_pernet:
37033706
unregister_pernet_device(&hwsim_net_ops);
3707+
out_free_rht:
3708+
rhashtable_destroy(&hwsim_radios_rht);
3709+
out_free_wq:
3710+
destroy_workqueue(hwsim_wq);
37043711
return err;
37053712
}
37063713
module_init(init_mac80211_hwsim);

include/uapi/linux/nl80211.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -981,18 +981,18 @@
981981
* only the %NL80211_ATTR_IE data is used and updated with this command.
982982
*
983983
* @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0
984-
* for the given authenticator address (specified with &NL80211_ATTR_MAC).
985-
* When &NL80211_ATTR_PMKR0_NAME is set, &NL80211_ATTR_PMK specifies the
984+
* for the given authenticator address (specified with %NL80211_ATTR_MAC).
985+
* When %NL80211_ATTR_PMKR0_NAME is set, %NL80211_ATTR_PMK specifies the
986986
* PMK-R0, otherwise it specifies the PMK.
987987
* @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously
988988
* configured PMK for the authenticator address identified by
989-
* &NL80211_ATTR_MAC.
989+
* %NL80211_ATTR_MAC.
990990
* @NL80211_CMD_PORT_AUTHORIZED: An event that indicates that the 4 way
991991
* handshake was completed successfully by the driver. The BSSID is
992-
* specified with &NL80211_ATTR_MAC. Drivers that support 4 way handshake
992+
* specified with %NL80211_ATTR_MAC. Drivers that support 4 way handshake
993993
* offload should send this event after indicating 802.11 association with
994-
* &NL80211_CMD_CONNECT or &NL80211_CMD_ROAM. If the 4 way handshake failed
995-
* &NL80211_CMD_DISCONNECT should be indicated instead.
994+
* %NL80211_CMD_CONNECT or %NL80211_CMD_ROAM. If the 4 way handshake failed
995+
* %NL80211_CMD_DISCONNECT should be indicated instead.
996996
*
997997
* @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request
998998
* and RX notification. This command is used both as a request to transmit
@@ -1029,9 +1029,9 @@
10291029
* initiated the connection through the connect request.
10301030
*
10311031
* @NL80211_CMD_STA_OPMODE_CHANGED: An event that notify station's
1032-
* ht opmode or vht opmode changes using any of &NL80211_ATTR_SMPS_MODE,
1033-
* &NL80211_ATTR_CHANNEL_WIDTH,&NL80211_ATTR_NSS attributes with its
1034-
* address(specified in &NL80211_ATTR_MAC).
1032+
* ht opmode or vht opmode changes using any of %NL80211_ATTR_SMPS_MODE,
1033+
* %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its
1034+
* address(specified in %NL80211_ATTR_MAC).
10351035
*
10361036
* @NL80211_CMD_MAX: highest used command number
10371037
* @__NL80211_CMD_AFTER_LAST: internal use
@@ -2218,7 +2218,7 @@ enum nl80211_commands {
22182218
* @NL80211_ATTR_EXTERNAL_AUTH_ACTION: Identify the requested external
22192219
* authentication operation (u32 attribute with an
22202220
* &enum nl80211_external_auth_action value). This is used with the
2221-
* &NL80211_CMD_EXTERNAL_AUTH request event.
2221+
* %NL80211_CMD_EXTERNAL_AUTH request event.
22222222
* @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user
22232223
* space supports external authentication. This attribute shall be used
22242224
* only with %NL80211_CMD_CONNECT request. The driver may offload
@@ -3491,7 +3491,7 @@ enum nl80211_sched_scan_match_attr {
34913491
* @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
34923492
* base on contiguous rules and wider channels will be allowed to cross
34933493
* multiple contiguous/overlapping frequency ranges.
3494-
* @NL80211_RRF_IR_CONCURRENT: See &NL80211_FREQUENCY_ATTR_IR_CONCURRENT
3494+
* @NL80211_RRF_IR_CONCURRENT: See %NL80211_FREQUENCY_ATTR_IR_CONCURRENT
34953495
* @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation
34963496
* @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
34973497
* @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
@@ -5643,11 +5643,11 @@ enum nl80211_nan_func_attributes {
56435643
* @NL80211_NAN_SRF_INCLUDE: present if the include bit of the SRF set.
56445644
* This is a flag.
56455645
* @NL80211_NAN_SRF_BF: Bloom Filter. Present if and only if
5646-
* &NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary.
5646+
* %NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary.
56475647
* @NL80211_NAN_SRF_BF_IDX: index of the Bloom Filter. Mandatory if
5648-
* &NL80211_NAN_SRF_BF is present. This is a u8.
5648+
* %NL80211_NAN_SRF_BF is present. This is a u8.
56495649
* @NL80211_NAN_SRF_MAC_ADDRS: list of MAC addresses for the SRF. Present if
5650-
* and only if &NL80211_NAN_SRF_BF isn't present. This is a nested
5650+
* and only if %NL80211_NAN_SRF_BF isn't present. This is a nested
56515651
* attribute. Each nested attribute is a MAC address.
56525652
* @NUM_NL80211_NAN_SRF_ATTR: internal
56535653
* @NL80211_NAN_SRF_ATTR_MAX: highest NAN SRF attribute

net/mac80211/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
10981098

10991099
ieee80211_led_init(local);
11001100

1101+
result = ieee80211_txq_setup_flows(local);
1102+
if (result)
1103+
goto fail_flows;
1104+
11011105
rtnl_lock();
11021106

11031107
result = ieee80211_init_rate_ctrl_alg(local,
@@ -1120,10 +1124,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
11201124

11211125
rtnl_unlock();
11221126

1123-
result = ieee80211_txq_setup_flows(local);
1124-
if (result)
1125-
goto fail_flows;
1126-
11271127
#ifdef CONFIG_INET
11281128
local->ifa_notifier.notifier_call = ieee80211_ifa_changed;
11291129
result = register_inetaddr_notifier(&local->ifa_notifier);
@@ -1149,15 +1149,15 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
11491149
#if defined(CONFIG_INET) || defined(CONFIG_IPV6)
11501150
fail_ifa:
11511151
#endif
1152-
ieee80211_txq_teardown_flows(local);
1153-
fail_flows:
11541152
rtnl_lock();
11551153
rate_control_deinitialize(local);
11561154
ieee80211_remove_interfaces(local);
11571155
fail_rate:
11581156
rtnl_unlock();
11591157
ieee80211_led_exit(local);
11601158
ieee80211_wep_free(local);
1159+
ieee80211_txq_teardown_flows(local);
1160+
fail_flows:
11611161
destroy_workqueue(local->workqueue);
11621162
fail_workqueue:
11631163
wiphy_unregister(local->hw.wiphy);

net/wireless/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev)
10121012
nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE);
10131013

10141014
list_del_rcu(&wdev->list);
1015+
synchronize_rcu();
10151016
rdev->devlist_generation++;
10161017

10171018
switch (wdev->iftype) {

net/wireless/util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,8 @@ int cfg80211_get_station(struct net_device *dev, const u8 *mac_addr,
17461746
if (!rdev->ops->get_station)
17471747
return -EOPNOTSUPP;
17481748

1749+
memset(sinfo, 0, sizeof(*sinfo));
1750+
17491751
return rdev_get_station(rdev, dev, mac_addr, sinfo);
17501752
}
17511753
EXPORT_SYMBOL(cfg80211_get_station);

0 commit comments

Comments
 (0)