Commit a6616bc9 authored by Takashi Iwai's avatar Takashi Iwai Committed by Kalle Valo

iwlwifi: dbg: Don't touch the tlv data

The commit ba8f6f4a ("iwlwifi: dbg: add dumping special device
memory") added a termination of name string just to be sure, and this
seems causing a regression, a GPF triggered at firmware loading.
Basically we shouldn't modify the firmware data that may be provided
as read-only.

This patch drops the code that caused the regression and keep the tlv
data as is.

Fixes: ba8f6f4a ("iwlwifi: dbg: add dumping special device memory")
BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1180344
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210733
Cc: stable@vger.kernel.org
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210112132449.22243-2-tiwai@suse.de
parent b7c56875
...@@ -180,13 +180,6 @@ static int iwl_dbg_tlv_alloc_region(struct iwl_trans *trans, ...@@ -180,13 +180,6 @@ static int iwl_dbg_tlv_alloc_region(struct iwl_trans *trans,
if (le32_to_cpu(tlv->length) < sizeof(*reg)) if (le32_to_cpu(tlv->length) < sizeof(*reg))
return -EINVAL; return -EINVAL;
/* For safe using a string from FW make sure we have a
* null terminator
*/
reg->name[IWL_FW_INI_MAX_NAME - 1] = 0;
IWL_DEBUG_FW(trans, "WRT: parsing region: %s\n", reg->name);
if (id >= IWL_FW_INI_MAX_REGION_ID) { if (id >= IWL_FW_INI_MAX_REGION_ID) {
IWL_ERR(trans, "WRT: Invalid region id %u\n", id); IWL_ERR(trans, "WRT: Invalid region id %u\n", id);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment