Skip to content

Commit de6b08f

Browse files
tklauserdavem330
authored andcommitted
net: ethoc: Use ether_addr_copy()
Use ether_addr_copy() instead of memcpy() to set netdev->dev_addr (which is 2-byte aligned). Signed-off-by: Tobias Klauser <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0ed4844 commit de6b08f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/ethoc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,14 +1148,14 @@ static int ethoc_probe(struct platform_device *pdev)
11481148

11491149
/* Allow the platform setup code to pass in a MAC address. */
11501150
if (pdata) {
1151-
memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN);
1151+
ether_addr_copy(netdev->dev_addr, pdata->hwaddr);
11521152
priv->phy_id = pdata->phy_id;
11531153
} else {
11541154
const void *mac;
11551155

11561156
mac = of_get_mac_address(pdev->dev.of_node);
11571157
if (mac)
1158-
memcpy(netdev->dev_addr, mac, IFHWADDRLEN);
1158+
ether_addr_copy(netdev->dev_addr, mac);
11591159
priv->phy_id = -1;
11601160
}
11611161

0 commit comments

Comments
 (0)