unsigned long now = jiffies;
        u8 wr_ptr;
 
+       /* Make sure the NIC is still alive in the bus */
+       if (trans_pcie->scheduled_for_removal)
+               return -EIO;
+
        if (!test_bit(txq_idx, trans_pcie->queue_used))
                return -EINVAL;
 
 
 
        lockdep_assert_held(&trans_pcie->reg_lock);
 
+       /* Make sure the NIC is still alive in the bus */
+       if (trans_pcie->scheduled_for_removal)
+               return -EIO;
+
        if (!(cmd->flags & CMD_SEND_IN_IDLE) &&
            !trans_pcie->ref_cmd_in_flight) {
                trans_pcie->ref_cmd_in_flight = true;
 
 int iwl_trans_pcie_send_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
 {
+       struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+
+       /* Make sure the NIC is still alive in the bus */
+       if (trans_pcie->scheduled_for_removal)
+               return -EIO;
+
        if (!(cmd->flags & CMD_SEND_IN_RFKILL) &&
            test_bit(STATUS_RFKILL_OPMODE, &trans->status)) {
                IWL_DEBUG_RF_KILL(trans, "Dropping CMD 0x%x: RF KILL\n",