Skip to content

Commit 2bf4ecb

Browse files
atenartdavem330
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 <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 55655e3 commit 2bf4ecb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/cadence/macb_main.c

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

0 commit comments

Comments
 (0)