
< 	read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
---
> 	if (!txq || txq->read_ptr < 0 || txq->read_ptr >= txq->n_window) {
> 		WARN_ON(1);
> 		return;
> 	}
> 	read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
