Skip to content

Commit

Permalink
net: stmmac: dwmac4: mac address array boudary violation issue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Biao Huang authored and David S. Miller committed Jul 9, 2019
1 parent 6ec3d4d commit efd58ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit efd58ad

Please sign in to comment.