Skip to content

Commit a166e5f

Browse files
jjagielskNipaLocal
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 <[email protected]> Signed-off-by: Jedrzej Jagielski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 2618947 commit a166e5f

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)