From: Dan Carpenter Date: Tue, 2 Mar 2010 21:07:24 +0000 (+0000) Subject: davinci_emac: off by one X-Git-Tag: v2.6.34-rc2~48^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d27b87785a743fdae653d395a3a4e763269c53c;p=profile%2Fcommon%2Fkernel-common.git 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: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 1ac9440e..32960b9 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -2385,7 +2385,7 @@ static int emac_dev_open(struct net_device *ndev) struct emac_priv *priv = netdev_priv(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]; /* Configuration items */