Skip to content

Commit 23786f4

Browse files
jjagielskgregkh
authored andcommitted
ixgbe: fix ixgbe_orom_civd_info struct layout
[ Upstream commit ed913b3 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6fdfa22 commit 23786f4

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
@@ -3123,7 +3123,7 @@ static int ixgbe_get_orom_ver_info(struct ixgbe_hw *hw,
31233123
if (err)
31243124
return err;
31253125

3126-
combo_ver = le32_to_cpu(civd.combo_ver);
3126+
combo_ver = get_unaligned_le32(&civd.combo_ver);
31273127

31283128
orom->major = (u8)FIELD_GET(IXGBE_OROM_VER_MASK, combo_ver);
31293129
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
@@ -1150,7 +1150,7 @@ struct ixgbe_orom_civd_info {
11501150
__le32 combo_ver; /* Combo Image Version number */
11511151
u8 combo_name_len; /* Length of the unicode combo image version string, max of 32 */
11521152
__le16 combo_name[32]; /* Unicode string representing the Combo Image version */
1153-
};
1153+
} __packed;
11541154

11551155
/* Function specific capabilities */
11561156
struct ixgbe_hw_func_caps {

0 commit comments

Comments
 (0)