Skip to content

Commit ed913b3

Browse files
jjagielskanguy11
authored andcommitted
ixgbe: fix ixgbe_orom_civd_info struct layout
The current layout of struct ixgbe_orom_civd_info causes incorrect data storage due to compiler-inserted padding. This results in issues when writing OROM data into the structure. Add the __packed attribute to ensure the structure layout matches the expected binary format without padding. Fixes: 70db078 ("ixgbe: read the OROM version information") Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent b1a0c97 commit ed913b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3125,7 +3125,7 @@ static int ixgbe_get_orom_ver_info(struct ixgbe_hw *hw,
31253125
if (err)
31263126
return err;
31273127

3128-
combo_ver = le32_to_cpu(civd.combo_ver);
3128+
combo_ver = get_unaligned_le32(&civd.combo_ver);
31293129

31303130
orom->major = (u8)FIELD_GET(IXGBE_OROM_VER_MASK, combo_ver);
31313131
orom->patch = (u8)FIELD_GET(IXGBE_OROM_VER_PATCH_MASK, combo_ver);

drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ struct ixgbe_orom_civd_info {
932932
__le32 combo_ver; /* Combo Image Version number */
933933
u8 combo_name_len; /* Length of the unicode combo image version string, max of 32 */
934934
__le16 combo_name[32]; /* Unicode string representing the Combo Image version */
935-
};
935+
} __packed;
936936

937937
/* Function specific capabilities */
938938
struct ixgbe_hw_func_caps {

0 commit comments

Comments
 (0)