]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Fri, 3 Apr 2020 02:23:29 +0000 (10:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Apr 2020 22:58:54 +0000 (15:58 -0700)
commiteb58406e0074efa30ae026fbe7cd526e8c1cc786
tree0a6b7d76f567dc85d34071509ccd6cc77ed44b1e
parentcc5a699c4b8e776a2836797241adb9d649ce8d85
net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting

Commit b237a80fcf1f ("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: b237a80fcf1f ("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>
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c