diff options
author | Kevin Hilman <khilman@linaro.org> | 2015-07-22 08:17:15 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-07-22 08:17:15 -0700 |
commit | 2447e09699cca5db52f86182f163f3a25d1089ab (patch) | |
tree | e16730dba489e5ea0f16737597525724daa5c770 /net/mac80211/key.c | |
parent | 5a277b6839c4ef6c6ccacff49b64f302598264bf (diff) | |
parent | c8bde72f9af412de57f0ceae218d648640118b0b (diff) |
Merge branch 'linux-4.1.y' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v4.1lsk-v4.1-15.07
* 'linux-4.1.y' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (126 commits)
Linux 4.1.3
Input: pixcir_i2c_ts - fix receive error
of/pci: Fix pci_address_to_pio() conversion of CPU address to I/O port
PCI: pciehp: Wait for hotplug command completion where necessary
PCI: Add pci_bus_addr_t
PCI: Propagate the "ignore hotplug" setting to parent
mtd: dc21285: use raw spinlock functions for nw_gpio_lock
mtd: fix: avoid race condition when accessing mtd->usecount
leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger
video: mxsfb: Make sure axi clock is enabled when accessing registers
genirq: devres: Fix testing return value of request_any_context_irq()
IB/srp: Fix reconnection failure handling
IB/srp: Fix connection state tracking
IB/srp: Fix a connection setup race
IB/srp: Remove an extraneous scsi_host_put() from an error path
scsi_transport_srp: Fix a race condition
scsi_transport_srp: Introduce srp_wait_for_queuecommand()
spi: pl022: Specify 'num-cs' property as required in devicetree binding
spi: orion: Fix maximum baud rates for Armada 370/XP
spi: fix race freeing dummy_tx/rx before it is unmapped
...
Diffstat (limited to 'net/mac80211/key.c')
-rw-r--r-- | net/mac80211/key.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index a907f2d5c12d..81e9785f38bc 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -66,12 +66,15 @@ update_vlan_tailroom_need_count(struct ieee80211_sub_if_data *sdata, int delta) if (sdata->vif.type != NL80211_IFTYPE_AP) return; - mutex_lock(&sdata->local->mtx); + /* crypto_tx_tailroom_needed_cnt is protected by this */ + assert_key_lock(sdata->local); + + rcu_read_lock(); - list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) + list_for_each_entry_rcu(vlan, &sdata->u.ap.vlans, u.vlan.list) vlan->crypto_tx_tailroom_needed_cnt += delta; - mutex_unlock(&sdata->local->mtx); + rcu_read_unlock(); } static void increment_tailroom_need_count(struct ieee80211_sub_if_data *sdata) @@ -95,6 +98,8 @@ static void increment_tailroom_need_count(struct ieee80211_sub_if_data *sdata) * http://mid.gmane.org/1308590980.4322.19.camel@jlt3.sipsolutions.net */ + assert_key_lock(sdata->local); + update_vlan_tailroom_need_count(sdata, 1); if (!sdata->crypto_tx_tailroom_needed_cnt++) { @@ -109,6 +114,8 @@ static void increment_tailroom_need_count(struct ieee80211_sub_if_data *sdata) static void decrease_tailroom_need_count(struct ieee80211_sub_if_data *sdata, int delta) { + assert_key_lock(sdata->local); + WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt < delta); update_vlan_tailroom_need_count(sdata, -delta); |