summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBiao Huang <biao.huang@mediatek.com>2019-07-09 10:36:22 +0800
committerDavid S. Miller <davem@davemloft.net>2019-07-09 14:17:59 -0700
commitefd58adf8f1fc8e9bd2b822d23eb3b603f3aec90 (patch)
tree570cf678bf43b5bcc84e4d379abd38f92a5d4241 /drivers
parent6ec3d4d2257e4101a8bbd809158093ef9a759144 (diff)
net: stmmac: dwmac4: mac address array boudary violation issue
The mac address array size is GMAC_MAX_PERFECT_ADDRESSES, so the 'reg' should be less than it, or will affect other registers. Signed-off-by: Biao Huang <biao.huang@mediatek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 8d9f6cda4012..776077ec1a23 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -454,7 +454,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw,
reg++;
}
- while (reg <= GMAC_MAX_PERFECT_ADDRESSES) {
+ while (reg < GMAC_MAX_PERFECT_ADDRESSES) {
writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
writel(0, ioaddr + GMAC_ADDR_LOW(reg));
reg++;