iwlwifi: dbg: check trigger data before access
authorMordechay Goodstein <mordechay.goodstein@intel.com>
Fri, 4 Mar 2022 11:21:27 +0000 (13:21 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 10 Mar 2022 07:23:29 +0000 (09:23 +0200)
Without trigger data set, no point in any collection.
so check that we have the info for collecting the data.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220304131517.5fb34fb1f0eb.I4d7f2a4d162e80474540c5caf1194ed7d32977bc@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c

index d3ac8ea049a43be02fe55018806c3d37f7b149d2..abf49022edbe414e3d8f20bf53ee9f3f4496abe5 100644 (file)
@@ -2905,6 +2905,11 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
        if (!test_bit(wk_idx, &fwrt->dump.active_wks))
                return;
 
+       if (!dump_data->trig) {
+               IWL_ERR(fwrt, "dump trigger data is not set\n");
+               goto out;
+       }
+
        if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) {
                IWL_ERR(fwrt, "Device is not enabled - cannot dump error\n");
                goto out;