Skip to content

Commit 907ed12

Browse files
Dan Carpentervireshk
authored andcommitted
OPP: call of_node_put() on error path in _bandwidth_supported()
This code does not call of_node_put(opp_np) if of_get_next_available_child() returns NULL. But it should. Fixes: 45679f9 ("opp: Don't parse icc paths unnecessarily") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 3123109 commit 907ed12

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/opp/of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,11 @@ static int _bandwidth_supported(struct device *dev, struct opp_table *opp_table)
437437

438438
/* Checking only first OPP is sufficient */
439439
np = of_get_next_available_child(opp_np, NULL);
440+
of_node_put(opp_np);
440441
if (!np) {
441442
dev_err(dev, "OPP table empty\n");
442443
return -EINVAL;
443444
}
444-
of_node_put(opp_np);
445445

446446
prop = of_find_property(np, "opp-peak-kBps", NULL);
447447
of_node_put(np);

0 commit comments

Comments
 (0)