of_node_put() was called twice in power_supply_check_supplies() whereas a single
call will also work. Rearrange code a bit to make that feasible.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
break;
ret = power_supply_find_supply_from_node(np);
+ of_node_put(np);
+
if (ret) {
dev_dbg(psy->dev, "Failed to find supply, defer!\n");
- of_node_put(np);
return -EPROBE_DEFER;
}
- of_node_put(np);
} while (np);
/* Missing valid "power-supplies" entries */