diff options
author | Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> | 2011-05-30 08:15:00 +0200 |
---|---|---|
committer | Philippe LANGLAIS <philippe.langlais@stericsson.com> | 2011-06-22 11:28:48 +0200 |
commit | b63eb7bfbab15655aee203e749dbfc2330c33160 (patch) | |
tree | b3970a31144a8475021504dc850aab43f0ff3e6d | |
parent | b5114b597264e71b4a2f4b7a682c21f086cc11a3 (diff) |
cw1200: fix for locked datapath after deauth.
When AP sent more than one deauth requests in a row, datapath
was remaining locked after deauthentication/unjoin. Result code of
queue_work() was not checked and datapath was not unlocked if
unjoin_work was already pending execution.
Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
Change-Id: I9c8394acd75e1aa828fad04c33bda118893ba031
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25615
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
-rw-r--r-- | drivers/staging/cw1200/sta.c | 3 | ||||
-rw-r--r-- | drivers/staging/cw1200/wsm.c | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c index 5f30cb4c338..8f1c59a6766 100644 --- a/drivers/staging/cw1200/sta.c +++ b/drivers/staging/cw1200/sta.c @@ -116,7 +116,8 @@ void cw1200_stop(struct ieee80211_hw *dev) switch (priv->join_status) { case CW1200_JOIN_STATUS_STA: wsm_lock_tx(priv); - queue_work(priv->workqueue, &priv->unjoin_work); + if (queue_work(priv->workqueue, &priv->unjoin_work) <= 0) + wsm_unlock_tx(priv); break; case CW1200_JOIN_STATUS_AP: /* If you see this warning please change the code to iterate diff --git a/drivers/staging/cw1200/wsm.c b/drivers/staging/cw1200/wsm.c index fa7fb2c246a..028e668f137 100644 --- a/drivers/staging/cw1200/wsm.c +++ b/drivers/staging/cw1200/wsm.c @@ -818,7 +818,9 @@ static int wsm_receive_indication(struct cw1200_common *priv, wsm_printk(KERN_DEBUG \ "[WSM] Issue unjoin command (RX).\n"); wsm_lock_tx_async(priv); - queue_work(priv->workqueue, &priv->unjoin_work); + if (queue_work(priv->workqueue, + &priv->unjoin_work) <= 0) + wsm_unlock_tx(priv); } } priv->wsm_cbc.rx(priv, &rx, skb_p); @@ -1310,7 +1312,8 @@ static bool wsm_handle_tx_data(struct cw1200_common *priv, wsm_lock_tx_async(priv); BUG_ON(priv->join_pending_frame); priv->join_pending_frame = wsm; - queue_work(priv->workqueue, &priv->join_work); + if (queue_work(priv->workqueue, &priv->join_work) <= 0) + wsm_unlock_tx(priv); handled = true; } break; @@ -1319,7 +1322,8 @@ static bool wsm_handle_tx_data(struct cw1200_common *priv, wsm_printk(KERN_DEBUG "[WSM] Issue set_default_wep_key.\n"); wsm_lock_tx_async(priv); priv->wep_default_key_id = tx_info->control.hw_key->keyidx; - queue_work(priv->workqueue, &priv->wep_key_work); + if (queue_work(priv->workqueue, &priv->wep_key_work) <= 0) + wsm_unlock_tx(priv); handled = true; } break; @@ -1357,7 +1361,9 @@ static bool wsm_handle_tx_data(struct cw1200_common *priv, wsm->more = 0; #endif /* 0 */ wsm_lock_tx_async(priv); - queue_work(priv->workqueue, &priv->unjoin_work); + if (queue_work(priv->workqueue, + &priv->unjoin_work) <= 0) + wsm_unlock_tx(priv); } } break; |