diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-10-20 15:25:00 +0200 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2017-01-26 09:38:55 +0200 |
commit | c2e27e16f2411155b906db201b7e478144034ffe (patch) | |
tree | 050af201cbf4ccba014fc62add9dc98c3903a43a /drivers/net/wireless | |
parent | 5bdaa0ef77065e07be5443b3cea5224ac72c9ac0 (diff) |
iwlwifi: mvm: properly check for transport data in dump
When copying from vmalloc'ed memory to the SG list, don't crash
if the transport didn't provide any data.
Fixes: 7e62a699aafb ("iwlwifi: mvm: use dev_coredumpsg()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c index e447cd92deb3..e7b3b712d778 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c @@ -848,11 +848,12 @@ dump_trans_data: sg_nents(sg_dump_data), fw_error_dump->op_mode_ptr, fw_error_dump->op_mode_len, 0); - sg_pcopy_from_buffer(sg_dump_data, - sg_nents(sg_dump_data), - fw_error_dump->trans_ptr->data, - fw_error_dump->trans_ptr->len, - fw_error_dump->op_mode_len); + if (fw_error_dump->trans_ptr) + sg_pcopy_from_buffer(sg_dump_data, + sg_nents(sg_dump_data), + fw_error_dump->trans_ptr->data, + fw_error_dump->trans_ptr->len, + fw_error_dump->op_mode_len); dev_coredumpsg(mvm->trans->dev, sg_dump_data, file_len, GFP_KERNEL); } |