If the device fails to probe - for example, when there is no
ethaddr set - then the private data is automatically freed
but the mdiobus remains registered.
Fixes:
1e354cb39314 ("drivers: net: fsl_enetc: register internal MDIO bus")
Signed-off-by: Michael Walle <michael@walle.cc>
{
struct enetc_priv *priv = dev_get_priv(dev);
+ if (miiphy_get_dev_by_name(priv->imdio.name))
+ mdio_unregister(&priv->imdio);
+
free(priv->enetc_txbd);
free(priv->enetc_rxbd);