net: mv643xx_eth: process retval from of_get_mac_address
authorMauri Sandberg <maukka@ext.kapsi.fi>
Wed, 23 Feb 2022 14:23:37 +0000 (16:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2022 10:47:57 +0000 (11:47 +0100)
commit62ca33976ddc6811969a8d5466efadb5f6ff5be3
tree54f845d4019f47d55cccc9c6b07f7cd3b22ba1ed
parent899e56a1ad435261812355550ae869d8be3df395
net: mv643xx_eth: process retval from of_get_mac_address

commit 42404d8f1c01861b22ccfa1d70f950242720ae57 upstream.

Obtaining a MAC address may be deferred in cases when the MAC is stored
in an NVMEM block, for example, and it may not be ready upon the first
retrieval attempt and return EPROBE_DEFER.

It is also possible that a port that does not rely on NVMEM has been
already created when getting the defer request. Thus, also the resources
allocated previously must be freed when doing a roll-back.

Fixes: 76723bca2802 ("net: mv643xx_eth: add DT parsing support")
Signed-off-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220223142337.41757-1-maukka@ext.kapsi.fi
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/mv643xx_eth.c