Skip to content

Commit 424c82e

Browse files
arndbjmberg-intel
authored andcommitted
wifi: iwlwifi: dbg_ini: fix structure packing
The iwl_fw_ini_error_dump_range structure has conflicting alignment requirements for the inner union and the outer struct: In file included from drivers/net/wireless/intel/iwlwifi/fw/dbg.c:9: drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2: error: field within 'struct iwl_fw_ini_error_dump_range' is less aligned than 'union iwl_fw_ini_error_dump_range::(anonymous at drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2)' and is usually due to 'struct iwl_fw_ini_error_dump_range' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { As the original intention was apparently to make the entire structure unaligned, mark the innermost members the same way so the union becomes packed as well. Fixes: 9731935 ("iwlwifi: dbg_ini: dump headers cleanup") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 2d4caa1 commit 424c82e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/wireless/intel/iwlwifi/fw/error-dump.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ struct iwl_fw_ini_fifo_hdr {
310310
struct iwl_fw_ini_error_dump_range {
311311
__le32 range_data_size;
312312
union {
313-
__le32 internal_base_addr;
314-
__le64 dram_base_addr;
315-
__le32 page_num;
313+
__le32 internal_base_addr __packed;
314+
__le64 dram_base_addr __packed;
315+
__le32 page_num __packed;
316316
struct iwl_fw_ini_fifo_hdr fifo_hdr;
317317
struct iwl_cmd_header fw_pkt_hdr;
318318
};

0 commit comments

Comments
 (0)