Commit ec06e9b9 authored by Johannes Berg's avatar Johannes Berg

wifi: iwlwifi: fw: dbg: ensure correct config name sizes

This hard-codes the size, but it's not obvious why that's
correct. Use sizeof() and cross-check the two structs.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Reviewed-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240128084842.58fcdea2ace7.I49cb1d7bdbea12085aada0c96ef42fcbcb3d2b38@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent ea1d166f
...@@ -2430,9 +2430,12 @@ static u32 iwl_dump_ini_info(struct iwl_fw_runtime *fwrt, ...@@ -2430,9 +2430,12 @@ static u32 iwl_dump_ini_info(struct iwl_fw_runtime *fwrt,
struct iwl_fw_ini_debug_info_tlv *debug_info = struct iwl_fw_ini_debug_info_tlv *debug_info =
(void *)node->tlv.data; (void *)node->tlv.data;
BUILD_BUG_ON(sizeof(cfg_name->cfg_name) !=
sizeof(debug_info->debug_cfg_name));
cfg_name->image_type = debug_info->image_type; cfg_name->image_type = debug_info->image_type;
cfg_name->cfg_name_len = cfg_name->cfg_name_len =
cpu_to_le32(IWL_FW_INI_MAX_CFG_NAME); cpu_to_le32(sizeof(cfg_name->cfg_name));
memcpy(cfg_name->cfg_name, debug_info->debug_cfg_name, memcpy(cfg_name->cfg_name, debug_info->debug_cfg_name,
sizeof(cfg_name->cfg_name)); sizeof(cfg_name->cfg_name));
cfg_name++; cfg_name++;
......
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