提交 ab1c637c 编写于 作者: A Andy Shevchenko 提交者: David S. Miller

stmmac: intel: Fix kernel crash due to wrong error path

Unfortunately sometimes ->probe() may fail. The commit b9663b7c
("net: stmmac: Enable SERDES power up/down sequence")
messed up with error handling and thus:

[   12.811311] ------------[ cut here ]------------
[   12.811993] kernel BUG at net/core/dev.c:9937!

Fix this by properly crafted error path.

Fixes: b9663b7c ("net: stmmac: Enable SERDES power up/down sequence")
Cc: Voon Weifeng <weifeng.voon@intel.com>
Cc: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6ef4889f
......@@ -4991,7 +4991,7 @@ int stmmac_dvr_probe(struct device *device,
priv->plat->bsp_priv);
if (ret < 0)
return ret;
goto error_serdes_powerup;
}
#ifdef CONFIG_DEBUG_FS
......@@ -5000,6 +5000,8 @@ int stmmac_dvr_probe(struct device *device,
return ret;
error_serdes_powerup:
unregister_netdev(ndev);
error_netdev_register:
phylink_destroy(priv->phylink);
error_phy_setup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册