Skip to content

Commit c2ace63

Browse files
committed
wifi: iwlwifi: read txq->read_ptr under lock
If we read txq->read_ptr without lock, we can read the same value twice, then obtain the lock, and reclaim from there to two different places, but crucially reclaim the same entry twice, resulting in the WARN_ONCE() a little later. Fix that by reading txq->read_ptr under lock. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240319100755.bf4c62196504.I978a7ca56c6bd6f1bf42c15aa923ba03366a840b@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 045a5b6 commit c2ace63

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/intel/iwlwifi/queue

1 file changed

+1
-1
lines changed

drivers/net/wireless/intel/iwlwifi/queue/tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,9 +1589,9 @@ void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn,
15891589
return;
15901590

15911591
tfd_num = iwl_txq_get_cmd_index(txq, ssn);
1592-
read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
15931592

15941593
spin_lock_bh(&txq->lock);
1594+
read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
15951595

15961596
if (!test_bit(txq_id, trans->txqs.queue_used)) {
15971597
IWL_DEBUG_TX_QUEUES(trans, "Q %d inactive - ignoring idx %d\n",

0 commit comments

Comments
 (0)