summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2022-03-08 14:57:39 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-16 14:26:44 +0100
commit5d07fca06b2e80c4ee70966c3fd27db8d1bb2c68 (patch)
treef47c072c156a4ec2f279544fa8b93009db90638a
parentaf6d58401ccbb6d98966e001dff09de3ccbd9ec8 (diff)
downloadlinux-stable-5d07fca06b2e80c4ee70966c3fd27db8d1bb2c68.tar.gz
linux-stable-5d07fca06b2e80c4ee70966c3fd27db8d1bb2c68.tar.bz2
linux-stable-5d07fca06b2e80c4ee70966c3fd27db8d1bb2c68.zip
net: ethernet: lpc_eth: Handle error for clk_enable
[ Upstream commit 2169b79258c8be803d2595d6456b1e77129fe154 ] As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: b7370112f519 ("lpc32xx: Added ethernet driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index bc39558fe82b..756f97dce85b 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1471,6 +1471,7 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct netdata_local *pldat;
+ int ret;
if (device_may_wakeup(&pdev->dev))
disable_irq_wake(ndev->irq);
@@ -1480,7 +1481,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
pldat = netdev_priv(ndev);
/* Enable interface clock */
- clk_enable(pldat->clk);
+ ret = clk_enable(pldat->clk);
+ if (ret)
+ return ret;
/* Reset and initialize */
__lpc_eth_reset(pldat);