Skip to content

Commit 3e1221a

Browse files
rvoskdavem330
authored andcommitted
net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting
Commit 9463c44 ("net: stmmac: dwmac1000: Clear unused address entries") cleared the unused mac address entries, but introduced an out-of bounds mac address register programming bug -- After setting the secondary unicast mac addresses, the "reg" value has reached netdev_uc_count() + 1, thus we should only clear address entries if (addr < perfect_addr_number) Fixes: 9463c44 ("net: stmmac: dwmac1000: Clear unused address entries") Signed-off-by: Jisheng Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 468c2a1 commit 3e1221a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
207207
reg++;
208208
}
209209

210-
while (reg <= perfect_addr_number) {
210+
while (reg < perfect_addr_number) {
211211
writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
212212
writel(0, ioaddr + GMAC_ADDR_LOW(reg));
213213
reg++;

0 commit comments

Comments
 (0)