powerpc/pseries: Fix possible leaked device node reference
PATCH 1/1 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.
--- arch/powerpc/platforms/pseries/dlpar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/platforms/pseries/dlpar.c +1 -2
@@ -421,11 +421,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)return -ENODEV ; dn =dlpar_configure_connector (cpu_to_be32 (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);
Quoted 6 lines · Nathan Fontenot
Failure return from
dlpar_configure_connectorwhen dlpar adding cpus results in leaking references to the cpus parent device node. Move the call toof_node_put()prior to checking the result ofdlpar_configure_connector.Fixes 8d5ff320766f ("powerpc/pseries: Make dlpar_configure_connector parent node aware")
That commit went into 3.12. Shouldn't this be CC to stable?
-Tyrel
Quoted 29 lines
Signed-off-by Nathan Fontenot <[email protected]>--- arch/powerpc/platforms/pseries/dlpar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/powerpc/platforms/pseries/dlpar.c +1
-2@@ -421,11 +421,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)return -ENODEV ; dn =dlpar_configure_connector (cpu_to_be32 (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);_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
Michael Ellerman
reviewerQuoted 9 lines · Tyrel Datwyler
Quoted 6 lines · Nathan Fontenot
Failure return from
dlpar_configure_connectorwhen dlpar adding cpus results in leaking references to the cpus parent device node. Move the call toof_node_put()prior to checking the result ofdlpar_configure_connector.Fixes 8d5ff320766f ("powerpc/pseries: Make dlpar_configure_connector parent node aware")That commit went into 3.12. Shouldn't this be CC to stable?
It could, but it fails the "real bug" test:
- It must fix a real bug that bothers people (not a, "This could be a problem..." type thing).
(from Documentation/stable_kernel_rules.txt)
Because the node we're leaking a reference on is /cpus, and in practice that's pretty harmless.
cheers