net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting
[ Upstream commit 3e1221acf6a8f8595b5ce354bab4327a69d54d18 ] Commit 9463c4455900 ("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: 9463c4455900 ("net: stmmac: dwmac1000: Clear unused address entries") Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4489253d06
commit
2a63744e67
1 changed files with 1 additions and 1 deletions
|
@ -188,7 +188,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
|
||||||
reg++;
|
reg++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (reg <= perfect_addr_number) {
|
while (reg < perfect_addr_number) {
|
||||||
writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
|
writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
|
||||||
writel(0, ioaddr + GMAC_ADDR_LOW(reg));
|
writel(0, ioaddr + GMAC_ADDR_LOW(reg));
|
||||||
reg++;
|
reg++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue