Fix a locking bug when removing an interface.

This commit is contained in:
Solomon Peachy 2013-04-09 15:24:01 -04:00
parent 6c78324f9d
commit e3621dcbf1
2 changed files with 3 additions and 4 deletions

View File

@ -233,7 +233,6 @@ void cw1200_remove_interface(struct ieee80211_hw *dev,
int i;
mutex_lock(&priv->conf_mutex);
wsm_lock_tx(priv);
switch (priv->join_status) {
case CW1200_JOIN_STATUS_JOINING:
case CW1200_JOIN_STATUS_PRE_STA:
@ -900,7 +899,7 @@ static int __cw1200_flush(struct cw1200_common *priv, bool drop)
wsm_lock_tx(priv);
if (!cw1200_queue_stats_is_empty(&priv->tx_queue_stats, -1)) {
/* Highly unlekely: WSM requeued frames. */
/* Highly unlikely: WSM requeued frames. */
wsm_unlock_tx(priv);
continue;
}
@ -1357,7 +1356,7 @@ void cw1200_join_timeout(struct work_struct *work)
pr_debug("[WSM] Join timed out.\n");
wsm_lock_tx(priv);
if (queue_work(priv->workqueue, &priv->unjoin_work) <= 0)
wsm_unlock_tx(priv);
wsm_unlock_tx(priv);
}
static void cw1200_do_unjoin(struct cw1200_common *priv)

View File

@ -1234,7 +1234,7 @@ bool wsm_flush_tx(struct cw1200_common *priv)
pending |= cw1200_queue_get_xmit_timestamp(
&priv->tx_queue[i],
&timestamp, 0xffffffff);
/* It is allowed to lock TX with only a command in the pipe. */
/* If there's nothing pending, we're good */
if (!pending)
return true;