Skip to content

Commit d89e5f7

Browse files
committed
wifi: iwlwifi: trans: cancel restart work on op mode leave
JIRA: https://issues.redhat.com/browse/RHEL-79791 commit 1801a94 Author: Miri Korenblit <miriam.rachel.korenblit@intel.com> Date: Thu Mar 6 12:25:48 2025 +0200 wifi: iwlwifi: trans: cancel restart work on op mode leave If the restart work happens to run after the opmode left (i.e. called iwl_trans_op_mode_leave), then the opmode memory (including its mutex) is likely to be freed already, and trans->opmode is NULL. Although the hw is stopped in that stage, which means that this restart got aborted (i.e. STATUS_RESET_PENDING will be cleared), it still can access trans->opmode (NULL pointer dereference) or the opmodes memory (which is freed). Fix this by canceling the restart wk in iwl_trans_op_mode_leave. Also make sure that the restart wk is really aborted. Fixes: 7391b2a ("wifi: iwlwifi: rework firmware error handling") Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Link: https://patch.msgid.link/20250306122425.801301ba1b8b.I6f6143f550b6335b699920c5d4b2b78449607a96@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent e5493c1 commit d89e5f7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/wireless/intel/iwlwifi/iwl-trans.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ void iwl_trans_op_mode_leave(struct iwl_trans *trans)
403403

404404
iwl_trans_pcie_op_mode_leave(trans);
405405

406+
cancel_work_sync(&trans->restart.wk);
407+
406408
trans->op_mode = NULL;
407409

408410
trans->state = IWL_TRANS_NO_FW;

0 commit comments

Comments
 (0)