summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/iwl-core.c
diff options
context:
space:
mode:
authorStanislaw Gruszka2011-04-28 11:51:32 +0200
committerJohn W. Linville2011-04-29 21:36:14 +0200
commit28a6e577c65cc317fed5265efc43ce9282928bd4 (patch)
tree4d99bbef18582fe6f1d211920e25d3705be0a87d /drivers/net/wireless/iwlegacy/iwl-core.c
parentiwlegacy: fix enqueue hcmd race conditions (diff)
downloadkernel-qcow2-linux-28a6e577c65cc317fed5265efc43ce9282928bd4.tar.gz
kernel-qcow2-linux-28a6e577c65cc317fed5265efc43ce9282928bd4.tar.xz
kernel-qcow2-linux-28a6e577c65cc317fed5265efc43ce9282928bd4.zip
iwlegacy: more priv->mutex serialization
Check status bits with mutex taken, because when we wait for mutex unlock, status can change. Patch should also make remaining sync commands be send with priv->mutex taken. That will prevent execute these commands when we are currently reset firmware, what could possibly cause troubles. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index 553c91b3a258..0073f9239197 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -2429,11 +2429,13 @@ void iwl_legacy_mac_bss_info_changed(struct ieee80211_hw *hw,
IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes);
- if (!iwl_legacy_is_alive(priv))
- return;
-
mutex_lock(&priv->mutex);
+ if (!iwl_legacy_is_alive(priv)) {
+ mutex_unlock(&priv->mutex);
+ return;
+ }
+
if (changes & BSS_CHANGED_QOS) {
unsigned long flags;