summaryrefslogtreecommitdiff
path: root/drivers/pci/pwrctrl/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pwrctrl/core.c')
-rw-r--r--drivers/pci/pwrctrl/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pci/pwrctrl/core.c b/drivers/pci/pwrctrl/core.c
index 7754baed67f2..97cff5b8ca88 100644
--- a/drivers/pci/pwrctrl/core.c
+++ b/drivers/pci/pwrctrl/core.c
@@ -299,8 +299,10 @@ static bool pci_pwrctrl_is_required(struct device_node *np)
struct device_node *remote __free(device_node) =
of_graph_get_remote_port_parent(endpoint);
if (remote) {
- if (of_pci_supply_present(remote))
+ if (of_pci_supply_present(remote)) {
+ of_node_put(endpoint);
return true;
+ }
}
}
}