Skip to content

Commit 2222ce0

Browse files
nfontmpe
authored andcommitted
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: 8d5ff32 ("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>
1 parent 202648a commit 2222ce0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • arch/powerpc/platforms/pseries

‎arch/powerpc/platforms/pseries/dlpar.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
421421
return -ENODEV;
422422

423423
dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
424+
of_node_put(parent);
424425
if (!dn)
425426
return -EINVAL;
426427

427-
of_node_put(parent);
428-
429428
rc = dlpar_attach_node(dn);
430429
if (rc) {
431430
dlpar_release_drc(drc_index);

0 commit comments

Comments
 (0)