提交 6c1e5abe 编写于 作者: T Thierry Reding 提交者: David S. Miller

net: stmmac: Stop PHY and remove TX timer on error

If an error occurs while opening the device, make sure that both the TX
timer and the PHY are properly cleaned up.
Signed-off-by: NThierry Reding <treding@nvidia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9fbb9dd8
......@@ -1821,7 +1821,7 @@ static int stmmac_open(struct net_device *dev)
netdev_err(priv->dev,
"%s: ERROR: allocating the IRQ %d (error: %d)\n",
__func__, dev->irq, ret);
goto init_error;
goto irq_error;
}
/* Request the Wake IRQ in case of another line is used for WoL */
......@@ -1858,7 +1858,11 @@ static int stmmac_open(struct net_device *dev)
free_irq(priv->wol_irq, dev);
wolirq_error:
free_irq(dev->irq, dev);
irq_error:
if (dev->phydev)
phy_stop(dev->phydev);
del_timer_sync(&priv->txtimer);
init_error:
free_dma_desc_resources(priv);
dma_desc_error:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册