Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06c11107 authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: Make ethernet addresses properly aligned



Reorder ethernet addresses allocated on stack or in non-packed
structures to keep them aligned(2).
Use ETH_ALEN as array length in places where it was hardcoded to 6.

Alignment verified using pahole where possible and target-tested
with BUG_ON() trap in ether_addr_copy.

Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c7ddc288
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -316,12 +316,11 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 variable, u8 *val)
static void rtl8192_read_eeprom_info(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);

	const u8 bMac_Tmp_Addr[ETH_ALEN] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01};
	u8 tempval;
	u8 ICVer8192, ICVer8256;
	u16 i, usValue, IC_Version;
	u16 EEPROMId;
	u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01};

	RT_TRACE(COMP_INIT, "====> rtl8192_read_eeprom_info\n");

+2 −4
Original line number Diff line number Diff line
@@ -2573,8 +2573,7 @@ static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
	int ret = -1;
	struct rtllib_device *ieee = priv->rtllib;
	u32 key[4];
	u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
	u8 zero_addr[6] = {0};
	const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
	struct iw_point *p = &wrq->u.data;
	struct ieee_param *ipw = NULL;

@@ -2611,8 +2610,7 @@ static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
				}

				if (ieee->pairwise_key_type) {
					if (memcmp(ieee->ap_mac_addr, zero_addr,
					    6) == 0)
					if (is_zero_ether_addr(ieee->ap_mac_addr))
						ieee->iw_mode = IW_MODE_ADHOC;
					memcpy((u8 *)key, ipw->u.crypt.key, 16);
					EnableHWSecurityConfig8192(dev);
+2 −2
Original line number Diff line number Diff line
@@ -987,8 +987,8 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,

	ret = rtllib_wx_set_encode_ext(ieee, info, wrqu, extra);
	{
		u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
		u8 zero[6] = {0};
		const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
		const u8 zero[ETH_ALEN] = {0};
		u32 key[4] = {0};
		struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
		struct iw_point *encoding = &wrqu->encoding;
+2 −2
Original line number Diff line number Diff line
@@ -255,8 +255,8 @@ union qos_tclas {
		u8		Priority;
		u8		ClassifierType;
		u8		Mask;
		u8		SrcAddr[6];
		u8		DstAddr[6];
		u8		SrcAddr[ETH_ALEN];
		u8		DstAddr[ETH_ALEN];
		u16		Type;
	} TYPE0_ETH;

+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ struct ts_common_info {
	struct list_head		List;
	struct timer_list		SetupTimer;
	struct timer_list		InactTimer;
	u8				Addr[6];
	u8				Addr[ETH_ALEN];
	union tspec_body TSpec;
	union qos_tclas TClass[TCLAS_NUM];
	u8				TClasProc;
Loading