@@ -1499,6 +1499,7 @@ static void _opp_table_kref_release(struct kref *kref)
dev_pm_opp_put(opp_table->current_opp);
_of_clear_opp_table(opp_table);
+ of_node_put(opp_table->np);
/* Release automatically acquired single clk */
if (!IS_ERR(opp_table->clk))
@@ -242,7 +242,6 @@ 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)
In _of_init_opp_table(), of_put_node() in the last line is not needed as the 'opp_np' is escaped out into 'opp_table->np' and ’opp_table' is an out parameter. We should call the of_node_put() when the 'opp_table' is released in _opp_table_kref_release(). Signed-off-by: Liang He <windhl@126.com> --- changelog: v2: (1) add the of_node_put() in _opp_table_kref_release() (2) rebase on linux-next/master (3) split v1 into two commits, opp_table->np and opp->np v1: https://lore.kernel.org/all/20220715144712.444104-1-windhl@126.com/ drivers/opp/core.c | 1 + drivers/opp/of.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)