提交 b2eb09af 编写于 作者: F Florian Fainelli 提交者: David S. Miller

net: stmmac: Fix error path after register_netdev move

Commit 57016590 ("net: stmmac: Fix race between stmmac_drv_probe and
stmmac_open") re-ordered how the MDIO bus registration and the network
device are registered, but missed to unwind the MDIO bus registration in
case we fail to register the network device.

Fixes: 57016590 ("net: stmmac: Fix race between stmmac_drv_probe and stmmac_open")
Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
Acked-by: NKweh, Hock Leong <hock.leong.kweh@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e4c5e13a
......@@ -3366,12 +3366,19 @@ int stmmac_dvr_probe(struct device *device,
}
ret = register_netdev(ndev);
if (ret)
if (ret) {
netdev_err(priv->dev, "%s: ERROR %i registering the device\n",
__func__, ret);
goto error_netdev_register;
}
return ret;
error_netdev_register:
if (priv->hw->pcs != STMMAC_PCS_RGMII &&
priv->hw->pcs != STMMAC_PCS_TBI &&
priv->hw->pcs != STMMAC_PCS_RTBI)
stmmac_mdio_unregister(ndev);
error_mdio_register:
netif_napi_del(&priv->napi);
error_hw_init:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册