Skip to content

Commit

Permalink
OPP: Don't drop opp_table->np reference while it is still in use
Browse files Browse the repository at this point in the history
The OPP table contains a reference of the DT node, opp_table->np,
throughout its lifetime. We shouldn't drop the refcount for the same
from _of_init_opp_table(), but do that while removing the OPP table
finally.

Signed-off-by: Liang He <windhl@126.com>
[ Viresh: Updated subject / commit log and drop reference from
	  _of_clear_opp_table() ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
  • Loading branch information
Liang He authored and Viresh Kumar committed Jul 19, 2022
1 parent 1e5fb38 commit ce736cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/opp/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ void _of_init_opp_table(struct opp_table *opp_table, struct device *dev,
opp_table->np = opp_np;

_opp_table_alloc_required_tables(opp_table, dev, opp_np);
of_node_put(opp_np);
}

void _of_clear_opp_table(struct opp_table *opp_table)
{
_opp_table_free_required_tables(opp_table);
of_node_put(opp_table->np);
}

/*
Expand Down

0 comments on commit ce736cf

Please sign in to comment.