mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
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 <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240319100755.bf4c62196504.I978a7ca56c6bd6f1bf42c15aa923ba03366a840b@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
045a5b645d
commit
c2ace63006
1 changed files with 1 additions and 1 deletions
|
@ -1589,9 +1589,9 @@ void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tfd_num = iwl_txq_get_cmd_index(txq, ssn);
|
tfd_num = iwl_txq_get_cmd_index(txq, ssn);
|
||||||
read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
|
|
||||||
|
|
||||||
spin_lock_bh(&txq->lock);
|
spin_lock_bh(&txq->lock);
|
||||||
|
read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
|
||||||
|
|
||||||
if (!test_bit(txq_id, trans->txqs.queue_used)) {
|
if (!test_bit(txq_id, trans->txqs.queue_used)) {
|
||||||
IWL_DEBUG_TX_QUEUES(trans, "Q %d inactive - ignoring idx %d\n",
|
IWL_DEBUG_TX_QUEUES(trans, "Q %d inactive - ignoring idx %d\n",
|
||||||
|
|
Loading…
Reference in a new issue