Skip to content

Commit 92c329d

Browse files
atenartclaudiubeznea
authored andcommitted
net: macb: do not copy the mac address if NULL
This patch fixes the MAC address setup in the probe. The MAC address retrieved using of_get_mac_address was checked for not containing an error, but it may also be NULL which wasn't tested. Fix it by replacing IS_ERR with IS_ERR_OR_NULL. Fixes: 541ddc6 ("net: macb: support of_get_mac_address new ERR_PTR error") Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
1 parent 5b42ec4 commit 92c329d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4177,7 +4177,7 @@ static int macb_probe(struct platform_device *pdev)
41774177
if (PTR_ERR(mac) == -EPROBE_DEFER) {
41784178
err = -EPROBE_DEFER;
41794179
goto err_out_free_netdev;
4180-
} else if (!IS_ERR(mac)) {
4180+
} else if (!IS_ERR_OR_NULL(mac)) {
41814181
ether_addr_copy(bp->dev->dev_addr, mac);
41824182
} else {
41834183
macb_get_hwaddr(bp);

0 commit comments

Comments
 (0)