Skip to content

Commit 0e1d9ca

Browse files
committed
opp: Call the missing clk_put() on error
Fix the clock reference counting by calling the missing clk_put() in the error path. Cc: v5.10 <[email protected]> # v5.10 Fixes: dd461cd ("opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER") Signed-off-by: Viresh Kumar <[email protected]>
1 parent 976509b commit 0e1d9ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/opp/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
11011101
ret = dev_pm_opp_of_find_icc_paths(dev, opp_table);
11021102
if (ret) {
11031103
if (ret == -EPROBE_DEFER)
1104-
goto remove_opp_dev;
1104+
goto put_clk;
11051105

11061106
dev_warn(dev, "%s: Error finding interconnect paths: %d\n",
11071107
__func__, ret);
@@ -1113,6 +1113,9 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
11131113

11141114
return opp_table;
11151115

1116+
put_clk:
1117+
if (!IS_ERR(opp_table->clk))
1118+
clk_put(opp_table->clk);
11161119
remove_opp_dev:
11171120
_remove_opp_dev(opp_dev, opp_table);
11181121
err:

0 commit comments

Comments
 (0)