diff --git a/drivers/net/ethernet/xilinx/xilinx_emacps.c b/drivers/net/ethernet/xilinx/xilinx_emacps.c index ae113c8f795df..7b4667ffb5b0c 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emacps.c +++ b/drivers/net/ethernet/xilinx/xilinx_emacps.c @@ -2919,6 +2919,7 @@ static int __devinit xemacps_probe(struct platform_device *pdev) u32 regval = 0; int rc = -ENXIO; int size = 0; + const u8* addr; r_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); r_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); @@ -3065,10 +3066,11 @@ static int __devinit xemacps_probe(struct platform_device *pdev) goto err_out_unregister_clk_notifier; } - lp->ndev->dev_addr = of_get_property(lp->pdev->dev.of_node, "local-mac-address", &size); - if ((!lp->ndev->dev_addr) || (size != 6)) { + addr = of_get_property(lp->pdev->dev.of_node, "local-mac-address", &size); + if ((!addr) || (size != 6)) { dev_warn(&lp->pdev->dev, "Could not find MAC address in device tree, use default\n"); } else { + memcpy(lp->ndev->dev_addr, addr, sizeof(addr)); xemacps_set_hwaddr(lp); } xemacps_update_hwaddr(lp);