On Wed, 3 Nov 2021 14:29:06 +0300 Dan Carpenter wrote: > > if (!priv->AutoloadFailFlag) { > > + u8 addr[ETH_ALEN]; > > + > > for (i = 0; i < 6; i += 2) { > > usValue = rtl92e_eeprom_read(dev, > > (EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1); > > - *(u16 *)(&dev->dev_addr[i]) = usValue; > > + *(u16 *)(&addr[i]) = usValue; > > No this doesn't work. It writes 2 bytes instead of one so it will > write one element beyond the end of addr[]. But the index moves by 2, IOW loop is only executed for i = 0, 2, 4. > It doesn't work at all on little endian systems. Indeed. > I'm not sure what's going on here or how to fix it but array overflows > are always bad. Same :(