Skip to content

Commit ef01cee

Browse files
jk-ozlabsdavem330
authored andcommitted
net: bmac: Fix read of MAC address from ROM
In bmac_get_station_address, We're reading two bytes at a time from ROM, but we do that six times, resulting in 12 bytes of read & writes. This means we will write off the end of the six-byte destination buffer. This change fixes the for-loop to only read/write six bytes. Based on a proposed fix from Finn Thain <[email protected]>. Signed-off-by: Jeremy Kerr <[email protected]> Reported-by: Stan Johnson <[email protected]> Tested-by: Stan Johnson <[email protected]> Reported-by: Finn Thain <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b15e626 commit ef01cee

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/apple

1 file changed

+1
-1
lines changed

drivers/net/ethernet/apple/bmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea)
11821182
int i;
11831183
unsigned short data;
11841184

1185-
for (i = 0; i < 6; i++)
1185+
for (i = 0; i < 3; i++)
11861186
{
11871187
reset_and_select_srom(dev);
11881188
data = read_srom(dev, i + EnetAddressOffset/2, SROMAddressBits);

0 commit comments

Comments
 (0)