summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2021-02-19 15:35:07 +0300
committerKalle Valo <kvalo@codeaurora.org>2021-02-22 10:22:16 +0300
commit4538c5ed0f7e892f1b643472e48146757d1e60c5 (patch)
tree8f1735f1fb660d895524df06f9ed96bce5c7854a /drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
parent94f0e6256c2ab6803c935634aa1f653174c94879 (diff)
downloadlinux-4538c5ed0f7e892f1b643472e48146757d1e60c5.tar.xz
iwlwifi: avoid crash on unsupported debug collection
If the opmode doesn't support debug collection (DVM) then don't crash, but just skip the callback. Fixes: d01293154c0a ("iwlwifi: dbg: add op_mode callback for collecting debug data.") Reported-by: Andy Lavr <andy.lavr@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210219133506.ecabe285bc7d.I73d230d555c595fa2d9bf284f80078729fe18aa4@changeid
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
index 868da7e79a45..e6d2e0994317 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
@@ -205,6 +205,8 @@ static inline void iwl_op_mode_time_point(struct iwl_op_mode *op_mode,
enum iwl_fw_ini_time_point tp_id,
union iwl_dbg_tlv_tp_data *tp_data)
{
+ if (!op_mode || !op_mode->ops || !op_mode->ops->time_point)
+ return;
op_mode->ops->time_point(op_mode, tp_id, tp_data);
}