struct ath11k *ar = hw->priv;
        int ret;
 
+       ret = ath11k_mac_wait_tx_complete(ar);
+       if (ret) {
+               ath11k_warn(ar->ab, "failed to wait tx complete: %d\n", ret);
+               return ret;
+       }
+
        mutex_lock(&ar->conf_mutex);
 
        ret = ath11k_dp_rx_pktlog_stop(ar->ab, true);
                goto cleanup;
        }
 
-       ret = ath11k_mac_wait_tx_complete(ar);
-       if (ret) {
-               ath11k_warn(ar->ab, "failed to wait tx complete: %d\n", ret);
-               goto cleanup;
-       }
-
        ret = ath11k_wow_set_hw_filter(ar);
        if (ret) {
                ath11k_warn(ar->ab, "failed to set hw filter: %d\n",