Message ID | 20190709023623.8358-2-biao.huang@mediatek.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | efd58adf8f1fc8e9bd2b822d23eb3b603f3aec90 |
Headers | show |
Series | fix out-of-boundary issue and add taller hash table support | expand |
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++;
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> --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)