]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/ethernet/allwinner/sun4i-emac.c
net: ethernet: fix similar warning reported by kbuild test robot
[linux.git] / drivers / net / ethernet / allwinner / sun4i-emac.c
index e1acafa82214133044765421109a84ff2168dd91..9e06dff619c333299eda915622f7c51179ed46ca 100644 (file)
@@ -870,8 +870,8 @@ static int emac_probe(struct platform_device *pdev)
 
        /* Read MAC-address from DT */
        mac_addr = of_get_mac_address(np);
-       if (mac_addr)
-               memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
+       if (!IS_ERR(mac_addr))
+               ether_addr_copy(ndev->dev_addr, mac_addr);
 
        /* Check if the MAC address is valid, if not get a random one */
        if (!is_valid_ether_addr(ndev->dev_addr)) {