Commit 04f4d750 authored by Nathan Fontenot's avatar Nathan Fontenot Committed by Kamal Mostafa

powerpc/pseries: Fix possible leaked device node reference

commit 2222ce0f upstream.

Failure return from dlpar_configure_connector when dlpar adding cpus
results in leaking references to the cpus parent device node. Move the
call to of_node_put() prior to checking the result of
dlpar_configure_connector.

Fixes: 8d5ff320 ("powerpc/pseries: Make dlpar_configure_connector parent node aware")
Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 77828bf4
......@@ -417,11 +417,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
return -ENODEV;
dn = dlpar_configure_connector(drc_index, parent);
of_node_put(parent);
if (!dn)
return -EINVAL;
of_node_put(parent);
rc = dlpar_attach_node(dn);
if (rc) {
dlpar_release_drc(drc_index);
......
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