]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: do not copy the mac address if NULL
authorAntoine Tenart <antoine.tenart@bootlin.com>
Fri, 21 Jun 2019 15:26:35 +0000 (17:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Jun 2019 15:57:41 +0000 (08:57 -0700)
commit1fbe998154f36cfe2f466bed8a02aa5dc27c2947
tree0e9d36e2d5bd5c293e46dd6e3a1f834d141d05c2
parentfabc437bc35faf09bf53136823aef561cafe486a
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: 1f8ceec0242d ("net: macb: support of_get_mac_address new ERR_PTR error")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c