diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-13 00:35:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-13 22:56:35 -0500 |
commit | 2447f2f3c38d3058d50de93df225ee6ad295932b (patch) | |
tree | 411f7dde320c07ec45cf354a62ca1f04263fc532 /drivers/net/cpmac.c | |
parent | 94de803db748b902a9442fcfd7aad31a2fde43b7 (diff) |
drivers/net/cpmac.c: Correct code taking the size of a pointer
sizeof(dev->dev_addr) is the size of a pointer. On the other hand,
sizeof(pdata->dev_addr) is the size of an array, so use that instead.
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression *x;
expression f;
type T;
@@
*f(...,(T)x,...)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cpmac.c')
-rw-r--r-- | drivers/net/cpmac.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 678222389407..8d0be26f94e3 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -1163,7 +1163,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1163 | priv->dev = dev; | 1163 | priv->dev = dev; |
1164 | priv->ring_size = 64; | 1164 | priv->ring_size = 64; |
1165 | priv->msg_enable = netif_msg_init(debug_level, 0xff); | 1165 | priv->msg_enable = netif_msg_init(debug_level, 0xff); |
1166 | memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); | 1166 | memcpy(dev->dev_addr, pdata->dev_addr, sizeof(pdata->dev_addr)); |
1167 | 1167 | ||
1168 | snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); | 1168 | snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); |
1169 | 1169 | ||