OPP: call of_node_put() on error path in _bandwidth_supported()
Subsystems (2)
PATCH 1/1 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 45679f9b508f ("opp: Don't parse icc paths unnecessarily")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/opp/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/opp/of.c +1 -1
@@ -437,11 +437,11 @@ static int _bandwidth_supported(struct device *dev, struct opp_table *opp_table)/* Checking only first OPP is sufficient */ np =of_get_next_available_child (opp_np,NULL ); +of_node_put (opp_np);if (!np) {dev_err (dev,"OPP table empty\n" );return -EINVAL ; } -of_node_put (opp_np); prop =of_find_property (np,"opp-peak-kBps" ,NULL );of_node_put (np);
Signature · 1 line
2.20.1
Viresh Kumar
AppliedQuoted 16 lines · Dan Carpenter
This code does not call
of_node_put(opp_np)ifof_get_next_available_child()returns NULL. But it should.Fixes 45679f9b508f ("opp: Don't parse icc paths unnecessarily")Signed-off-by Dan Carpenter <[email protected]>--- drivers/opp/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/opp/of.c +0
-0@@ -437,11 +437,11 @@ static int _bandwidth_supported(struct device *dev, struct opp_table *opp_table)/* Checking only first OPP is sufficient */
drivers/opp/of.c static int _bandwidth_supported(struct device *dev, struct opp_table *opp_table) · line 447
Quoted 10 lines
drivers/opp/of.c +1
-1np =of_get_next_available_child (opp_np,NULL ); +of_node_put (opp_np);if (!np) {dev_err (dev,"OPP table empty\n" );return -EINVAL ; } -of_node_put (opp_np); prop =of_find_property (np,"opp-peak-kBps" ,NULL );of_node_put (np);
Applied. Thanks.
Signature · 1 line
viresh