Commit 53a92889 authored by Zhang Changzhong's avatar Zhang Changzhong Committed by David S. Miller
Browse files

net: bcmgenet: add missed clk_disable_unprepare in bcmgenet_probe



The driver forgets to call clk_disable_unprepare() in error path after
a success calling for clk_prepare_enable().

Fix to goto err_clk_disable if clk_prepare_enable() is successful.

Fixes: c80d36ff ("net: bcmgenet: Use devm_clk_get_optional() to get the clocks")
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: default avatarDoug Berger <opendmb@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24a63fe6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4000,14 +4000,14 @@ static int bcmgenet_probe(struct platform_device *pdev)
	if (IS_ERR(priv->clk_wol)) {
		dev_dbg(&priv->pdev->dev, "failed to get enet-wol clock\n");
		err = PTR_ERR(priv->clk_wol);
		goto err;
		goto err_clk_disable;
	}

	priv->clk_eee = devm_clk_get_optional(&priv->pdev->dev, "enet-eee");
	if (IS_ERR(priv->clk_eee)) {
		dev_dbg(&priv->pdev->dev, "failed to get enet-eee clock\n");
		err = PTR_ERR(priv->clk_eee);
		goto err;
		goto err_clk_disable;
	}

	/* If this is an internal GPHY, power it on now, before UniMAC is