提交 4d27b877 编写于 作者: D Dan Carpenter 提交者: David S. Miller

davinci_emac: off by one

This off by one error was found by smatch.

drivers/net/davinci_emac.c +2390 emac_dev_open(13) error: buffer overflow 'priv->mac_addr' 6 <= 6
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 bf829370
...@@ -2385,7 +2385,7 @@ static int emac_dev_open(struct net_device *ndev) ...@@ -2385,7 +2385,7 @@ static int emac_dev_open(struct net_device *ndev)
struct emac_priv *priv = netdev_priv(ndev); struct emac_priv *priv = netdev_priv(ndev);
netif_carrier_off(ndev); netif_carrier_off(ndev);
for (cnt = 0; cnt <= ETH_ALEN; cnt++) for (cnt = 0; cnt < ETH_ALEN; cnt++)
ndev->dev_addr[cnt] = priv->mac_addr[cnt]; ndev->dev_addr[cnt] = priv->mac_addr[cnt];
/* Configuration items */ /* Configuration items */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册