diff --git a/drivers/net/wireless/cw1200/scan.c b/drivers/net/wireless/cw1200/scan.c index 3fab2aa..b997e1a 100644 --- a/drivers/net/wireless/cw1200/scan.c +++ b/drivers/net/wireless/cw1200/scan.c @@ -262,12 +262,6 @@ fail: static void cw1200_scan_restart_delayed(struct cw1200_common *priv) { - if (priv->delayed_link_loss) { - wiphy_dbg(priv->hw->wiphy, "[CQM] Requeue BSS loss.\n"); - priv->delayed_link_loss = 0; - cw1200_cqm_bssloss_sm(priv, 1, 0, 0); - } - /* FW bug: driver has to restart p2p-dev mode after scan. */ if (priv->join_status == CW1200_JOIN_STATUS_MONITOR) { cw1200_enable_listening(priv); @@ -275,9 +269,15 @@ static void cw1200_scan_restart_delayed(struct cw1200_common *priv) } if (priv->delayed_unjoin) { + priv->delayed_link_loss = 0; priv->delayed_unjoin = false; if (queue_work(priv->workqueue, &priv->unjoin_work) <= 0) wsm_unlock_tx(priv); + } else if (priv->delayed_link_loss) { + wiphy_dbg(priv->hw->wiphy, "[CQM] Requeue BSS loss.\n"); + priv->delayed_link_loss = 0; + cw1200_cqm_bssloss_sm(priv, 1, 0, 0); + } } }