Commit 265e2cf6 authored by Eric Anholt's avatar Eric Anholt Committed by Rafael J. Wysocki
Browse files

PM / Domains: Fix bad of_node_put() in failure paths of genpd_dev_pm_attach()

It looks like these meant to be unreffing the
of_parse_phandle_with_args() node, since the error paths above it
don't do of_node_put.  That function returns a new ref in,
though, not a new ref on dev->of_node.  Also, it would have leaked the
ref in the success case.

Fixes "ERROR: Bad of_node_put()" on bcm2835 in the -EPROBE_DEFER case.

Fixes: aa42240a

 (PM / Domains: Add generic OF-based PM domain look-up)
Signed-off-by: default avatarEric Anholt <>
Acked-by: default avatarUlf Hansson <>
Acked-by: default avatarKevin Hilman <>
Cc: 3.18+ <> # 3.18+
Signed-off-by: default avatarRafael J. Wysocki <>
parent 712caed4
......@@ -1773,10 +1773,10 @@ int genpd_dev_pm_attach(struct device *dev)
pd = of_genpd_get_from_provider(&pd_args);
if (IS_ERR(pd)) {
dev_dbg(dev, "%s() failed to find PM domain: %ld\n",
__func__, PTR_ERR(pd));
......@@ -1794,7 +1794,6 @@ int genpd_dev_pm_attach(struct device *dev)
if (ret < 0) {
dev_err(dev, "failed to add to PM domain %s: %d",
pd->name, ret);
goto out;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment