From: Linus Walleij Date: Fri, 8 Jul 2022 23:55:29 +0000 (+0200) Subject: ixp4xx_eth: Fall back to random MAC address X-Git-Tag: v6.0-rc1~141^2~165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3ba206ce84d3d5c963ea670c94d4de1335b6516;p=thirdparty%2Flinux.git ixp4xx_eth: Fall back to random MAC address If the firmware does not provide a MAC address to the driver, fall back to generating a random MAC address. Signed-off-by: Linus Walleij Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 89770c2e0ffb1..a5d1d8d120645 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -1487,7 +1487,10 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) port->plat = plat; npe_port_tab[NPE_ID(port->id)] = port; - eth_hw_addr_set(ndev, plat->hwaddr); + if (is_valid_ether_addr(plat->hwaddr)) + eth_hw_addr_set(ndev, plat->hwaddr); + else + eth_hw_addr_random(ndev); platform_set_drvdata(pdev, ndev);