* [PATCH] powerpc/pseries: Fix possible leaked device node reference
@ 2015-04-30 1:44 Nathan Fontenot
2015-04-30 21:58 ` Tyrel Datwyler
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Fontenot @ 2015-04-30 1:44 UTC (permalink / raw)
To: linuxppc-dev, Michael Ellerman
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: 8d5ff320766f ("powerpc/pseries: Make dlpar_configure_connector parent node aware")
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/dlpar.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 019d34a..47d9cebe 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/pseries: Fix possible leaked device node reference
2015-04-30 1:44 [PATCH] powerpc/pseries: Fix possible leaked device node reference Nathan Fontenot
@ 2015-04-30 21:58 ` Tyrel Datwyler
2015-04-30 23:47 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Tyrel Datwyler @ 2015-04-30 21:58 UTC (permalink / raw)
To: Nathan Fontenot, linuxppc-dev, Michael Ellerman
On 04/29/2015 06:44 PM, Nathan Fontenot wrote:
> 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: 8d5ff320766f ("powerpc/pseries: Make dlpar_configure_connector parent node aware")
That commit went into 3.12. Shouldn't this be CC to stable?
-Tyrel
>
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> ---
> arch/powerpc/platforms/pseries/dlpar.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
> index 019d34a..47d9cebe 100644
> --- a/arch/powerpc/platforms/pseries/dlpar.c
> +++ b/arch/powerpc/platforms/pseries/dlpar.c
> @@ -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
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/pseries: Fix possible leaked device node reference
2015-04-30 21:58 ` Tyrel Datwyler
@ 2015-04-30 23:47 ` Michael Ellerman
0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2015-04-30 23:47 UTC (permalink / raw)
To: Tyrel Datwyler; +Cc: Nathan Fontenot, linuxppc-dev
On Thu, 2015-04-30 at 14:58 -0700, Tyrel Datwyler wrote:
> On 04/29/2015 06:44 PM, Nathan Fontenot wrote:
> > 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: 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-30 23:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 1:44 [PATCH] powerpc/pseries: Fix possible leaked device node reference Nathan Fontenot
2015-04-30 21:58 ` Tyrel Datwyler
2015-04-30 23:47 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).