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:51:02 +0000 (11:51 +0100)
commitbb9753aa6476007ef98e3dfe1dadaaef9ede2fa0
treee0d1ae75ff1d7e96015c7235cf99e2544f0e6063
parenta739963f43269297c3f438b776194542e2a97499
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