Commit ed913b34 authored by Jedrzej Jagielski's avatar Jedrzej Jagielski Committed by Tony Nguyen
Browse files

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: 70db0788 ("ixgbe: read the OROM version information")
Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: default avatarJedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent b1a0c977
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3125,7 +3125,7 @@ static int ixgbe_get_orom_ver_info(struct ixgbe_hw *hw,
	if (err)
		return err;

	combo_ver = le32_to_cpu(civd.combo_ver);
	combo_ver = get_unaligned_le32(&civd.combo_ver);

	orom->major = (u8)FIELD_GET(IXGBE_OROM_VER_MASK, combo_ver);
	orom->patch = (u8)FIELD_GET(IXGBE_OROM_VER_PATCH_MASK, combo_ver);
+1 −1
Original line number Diff line number Diff line
@@ -932,7 +932,7 @@ struct ixgbe_orom_civd_info {
	__le32 combo_ver;	/* Combo Image Version number */
	u8 combo_name_len;	/* Length of the unicode combo image version string, max of 32 */
	__le16 combo_name[32];	/* Unicode string representing the Combo Image version */
};
} __packed;

/* Function specific capabilities */
struct ixgbe_hw_func_caps {