Skip to content

Commit ce736cf

Browse files
windhlvireshk
authored andcommitted
OPP: Don't drop opp_table->np reference while it is still in use
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 <[email protected]> [ Viresh: Updated subject / commit log and drop reference from _of_clear_opp_table() ] Signed-off-by: Viresh Kumar <[email protected]>
1 parent 1e5fb38 commit ce736cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/opp/of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ void _of_init_opp_table(struct opp_table *opp_table, struct device *dev,
242242
opp_table->np = opp_np;
243243

244244
_opp_table_alloc_required_tables(opp_table, dev, opp_np);
245-
of_node_put(opp_np);
246245
}
247246

248247
void _of_clear_opp_table(struct opp_table *opp_table)
249248
{
250249
_opp_table_free_required_tables(opp_table);
250+
of_node_put(opp_table->np);
251251
}
252252

253253
/*

0 commit comments

Comments
 (0)