Commit 36e69da8 authored by Adam Ford's avatar Adam Ford Committed by David S. Miller

net: ethernet: ravb: Fix release of refclk

The call to clk_disable_unprepare() can happen before priv is
initialized. This means moving clk_disable_unprepare out of
out_release into a new label.

Fixes: 8ef7adc6 ("net: ethernet: ravb: Enable optional refclk")
Signed-off-by: default avatarAdam Ford <aford173@gmail.com>
Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 17cb0070
...@@ -2173,7 +2173,7 @@ static int ravb_probe(struct platform_device *pdev) ...@@ -2173,7 +2173,7 @@ static int ravb_probe(struct platform_device *pdev)
/* Set GTI value */ /* Set GTI value */
error = ravb_set_gti(ndev); error = ravb_set_gti(ndev);
if (error) if (error)
goto out_release; goto out_disable_refclk;
/* Request GTI loading */ /* Request GTI loading */
ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI); ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI);
...@@ -2192,7 +2192,7 @@ static int ravb_probe(struct platform_device *pdev) ...@@ -2192,7 +2192,7 @@ static int ravb_probe(struct platform_device *pdev)
"Cannot allocate desc base address table (size %d bytes)\n", "Cannot allocate desc base address table (size %d bytes)\n",
priv->desc_bat_size); priv->desc_bat_size);
error = -ENOMEM; error = -ENOMEM;
goto out_release; goto out_disable_refclk;
} }
for (q = RAVB_BE; q < DBAT_ENTRY_NUM; q++) for (q = RAVB_BE; q < DBAT_ENTRY_NUM; q++)
priv->desc_bat[q].die_dt = DT_EOS; priv->desc_bat[q].die_dt = DT_EOS;
...@@ -2252,8 +2252,9 @@ static int ravb_probe(struct platform_device *pdev) ...@@ -2252,8 +2252,9 @@ static int ravb_probe(struct platform_device *pdev)
/* Stop PTP Clock driver */ /* Stop PTP Clock driver */
if (chip_id != RCAR_GEN2) if (chip_id != RCAR_GEN2)
ravb_ptp_stop(ndev); ravb_ptp_stop(ndev);
out_release: out_disable_refclk:
clk_disable_unprepare(priv->refclk); clk_disable_unprepare(priv->refclk);
out_release:
free_netdev(ndev); free_netdev(ndev);
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment