Skip to content

Commit 36e69da

Browse files
aford173davem330
authored andcommitted
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: 8ef7adc ("net: ethernet: ravb: Enable optional refclk") Signed-off-by: Adam Ford <[email protected]> Reviewed-by: Sergei Shtylyov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 17cb007 commit 36e69da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ static int ravb_probe(struct platform_device *pdev)
21732173
/* Set GTI value */
21742174
error = ravb_set_gti(ndev);
21752175
if (error)
2176-
goto out_release;
2176+
goto out_disable_refclk;
21772177

21782178
/* Request GTI loading */
21792179
ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI);
@@ -2192,7 +2192,7 @@ static int ravb_probe(struct platform_device *pdev)
21922192
"Cannot allocate desc base address table (size %d bytes)\n",
21932193
priv->desc_bat_size);
21942194
error = -ENOMEM;
2195-
goto out_release;
2195+
goto out_disable_refclk;
21962196
}
21972197
for (q = RAVB_BE; q < DBAT_ENTRY_NUM; q++)
21982198
priv->desc_bat[q].die_dt = DT_EOS;
@@ -2252,8 +2252,9 @@ static int ravb_probe(struct platform_device *pdev)
22522252
/* Stop PTP Clock driver */
22532253
if (chip_id != RCAR_GEN2)
22542254
ravb_ptp_stop(ndev);
2255-
out_release:
2255+
out_disable_refclk:
22562256
clk_disable_unprepare(priv->refclk);
2257+
out_release:
22572258
free_netdev(ndev);
22582259

22592260
pm_runtime_put(&pdev->dev);

0 commit comments

Comments
 (0)