Skip to content

Commit 089e501

Browse files
AviSternlucacoelho
authored andcommitted
iwlwifi: mvm: take the required lock when clearing time event data
When receiving a session protection end notification, the time event data is cleared without holding the required lock. Fix it. Signed-off-by: Avraham Stern <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200306151128.a49846a634e4.Id1ada7c5a964f5e25f4d0eacc2c4b050015b46a2@changeid
1 parent b102f0c commit 089e501

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,9 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,
785785
if (!le32_to_cpu(notif->status)) {
786786
iwl_mvm_te_check_disconnect(mvm, vif,
787787
"Session protection failure");
788+
spin_lock_bh(&mvm->time_event_lock);
788789
iwl_mvm_te_clear_data(mvm, te_data);
790+
spin_unlock_bh(&mvm->time_event_lock);
789791
}
790792

791793
if (le32_to_cpu(notif->start)) {
@@ -801,7 +803,9 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,
801803
*/
802804
iwl_mvm_te_check_disconnect(mvm, vif,
803805
"No beacon heard and the session protection is over already...");
806+
spin_lock_bh(&mvm->time_event_lock);
804807
iwl_mvm_te_clear_data(mvm, te_data);
808+
spin_unlock_bh(&mvm->time_event_lock);
805809
}
806810

807811
goto out_unlock;

0 commit comments

Comments
 (0)