mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
powerpc/pseries: Fix possible leaked device node reference
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: 8d5ff32076
("powerpc/pseries: Make dlpar_configure_connector parent node aware")
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
202648a607
commit
2222ce0fbb
1 changed files with 1 additions and 2 deletions
|
@ -421,11 +421,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
|
dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
|
||||||
|
of_node_put(parent);
|
||||||
if (!dn)
|
if (!dn)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
of_node_put(parent);
|
|
||||||
|
|
||||||
rc = dlpar_attach_node(dn);
|
rc = dlpar_attach_node(dn);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dlpar_release_drc(drc_index);
|
dlpar_release_drc(drc_index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue