From: Biao Huang Date: Tue, 9 Jul 2019 02:36:22 +0000 (+0800) Subject: net: stmmac: dwmac4: mac address array boudary violation issue X-Git-Tag: v5.4-rc1~616^2~8^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=efd58adf8f1fc8e9bd2b822d23eb3b603f3aec90;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 8d9f6cd..776077e 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++;