Skip to content

Commit 9c59a01

Browse files
Yuuoniybebarino
authored andcommitted
clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe
pm_runtime_get_sync() will increment pm usage counter. Forgetting to putting operation will result in reference leak. Add missing pm_runtime_put_sync in some error paths. Fixes: 9ac33b0 ("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220602030838.52057-1-linmq006@gmail.com Reviewed-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent d61876a commit 9c59a01

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/clk/ti/clk-dra7-atl.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,16 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
245245
if (rc) {
246246
pr_err("%s: failed to lookup atl clock %d\n", __func__,
247247
i);
248-
return -EINVAL;
248+
ret = -EINVAL;
249+
goto pm_put;
249250
}
250251

251252
clk = of_clk_get_from_provider(&clkspec);
252253
if (IS_ERR(clk)) {
253254
pr_err("%s: failed to get atl clock %d from provider\n",
254255
__func__, i);
255-
return PTR_ERR(clk);
256+
ret = PTR_ERR(clk);
257+
goto pm_put;
256258
}
257259

258260
cdesc = to_atl_desc(__clk_get_hw(clk));
@@ -285,8 +287,9 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
285287
if (cdesc->enabled)
286288
atl_clk_enable(__clk_get_hw(clk));
287289
}
288-
pm_runtime_put_sync(cinfo->dev);
289290

291+
pm_put:
292+
pm_runtime_put_sync(cinfo->dev);
290293
return ret;
291294
}
292295

0 commit comments

Comments
 (0)