struct txq_entry_t *tqe = NULL;
unsigned long flags;
+ if (wilc->txq_entries <= 0 || wilc->txq[q_num].count == 0) {
+ pr_err("%s: txq_entries is 0\n", __func__);
+ return tqe;
+ }
+ if (wilc == NULL)
+ pr_err("%s: wilc is NULL\n", __func__);
+ if (wilc->txq == NULL)
+ pr_err("%s: wilc->txq is NULL\n", __func__);
spin_lock_irqsave(&wilc->txq_spinlock, flags);
if (!list_empty(&wilc->txq[q_num].txq_head.list)) {
tqe = list_first_entry(&wilc->txq[q_num].txq_head.list,
struct txq_entry_t, list);
- list_del(&tqe->list);
- wilc->txq_entries -= 1;
- wilc->txq[q_num].count--;
+ if (tqe) {
+ if(list_empty(&tqe->list))
+ pr_err("%s: &tqe->list is empty\n", __func__);
+ else {
+ list_del(&tqe->list);
+ wilc->txq_entries -= 1;
+ wilc->txq[q_num].count--;
+ }
+ }
+ else
+ pr_err("%s: tqe is NULL\n", __func__);
}
spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
return tqe;
mutex_unlock(&wilc->txq_add_to_head_cs);
*txq_count = wilc->txq_entries;
- if (ret == 1)
- cfg_packet_timeout = 0;
return ret;
}