]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: iwlwifi: mvm: fix race condition in PTP removal
authorJunjie Cao <junjie.cao@intel.com>
Thu, 12 Feb 2026 12:50:34 +0000 (20:50 +0800)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 26 May 2026 12:17:08 +0000 (15:17 +0300)
commit65150c9cc3e06ab54bc4e8134a47f6f5d095a4e3
tree4b4524644151bb1a76a6d994a17eda5ced34841d
parente1fc08598aa34b28359831e768076f56632720c1
wifi: iwlwifi: mvm: fix race condition in PTP removal

iwl_mvm_ptp_remove() calls cancel_delayed_work_sync() only after
ptp_clock_unregister() and clearing ptp_data state (ptp_clock,
ptp_clock_info, last_gp2).

This creates a race where the delayed work iwl_mvm_ptp_work() can
execute between ptp_clock_unregister() and cancel_delayed_work_sync(),
observing partially cleared PTP state.

Move cancel_delayed_work_sync() before ptp_clock_unregister() to
ensure the delayed work is fully stopped before any PTP cleanup
begins.

Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Junjie Cao <junjie.cao@intel.com>
Link: https://patch.msgid.link/20260212125035.1345718-1-junjie.cao@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/ptp.c