Skip to content

Commit 8979ef7

Browse files
bebarinovireshk
authored andcommitted
opp: Put opp table in dev_pm_opp_set_rate() for empty tables
We get the opp_table pointer at the top of the function and so we should put the pointer at the end of the function like all other exit paths from this function do. Cc: v5.7+ <[email protected]> # v5.7+ Fixes: aca48b6 ("opp: Manage empty OPP tables with clk handle") Reviewed-by: Rajendra Nayak <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> [ Viresh: Split the patch into two ] Signed-off-by: Viresh Kumar <[email protected]>
1 parent 9123e3a commit 8979ef7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/opp/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,10 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
893893
* have OPP table for the device, while others don't and
894894
* opp_set_rate() just needs to behave like clk_set_rate().
895895
*/
896-
if (!_get_opp_count(opp_table))
897-
return 0;
896+
if (!_get_opp_count(opp_table)) {
897+
ret = 0;
898+
goto put_opp_table;
899+
}
898900

899901
if (!opp_table->required_opp_tables && !opp_table->regulators &&
900902
!opp_table->paths) {

0 commit comments

Comments
 (0)