[PATCH] powerpc/pseries: Fix possible leaked device node reference

Tyrel Datwyler tyreld at linux.vnet.ibm.com
Fri May 1 07:58:33 AEST 2015


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 at 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 at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 



More information about the Linuxppc-dev mailing list