Skip to content

Commit

Permalink
davinci_emac: off by one
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
error27 authored and davem330 committed Mar 3, 2010
1 parent bf82937 commit 4d27b87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4d27b87

Please sign in to comment.