lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <ec50fa3a-1012-805f-2541-1519ef1c0327@linux.vnet.ibm.com>
Date:   Mon, 6 Feb 2017 15:05:42 -0800
From:   Tyrel Datwyler <tyreld@...ux.vnet.ibm.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        benh@...nel.crashing.org, paulus@...ba.org, mpe@...erman.id.au,
        nfont@...ux.vnet.ibm.com, jallen@...ux.vnet.ibm.com
Cc:     kernel-janitors@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc/pseries: Fix missing of_node_put

On 02/06/2017 01:36 PM, Christophe JAILLET wrote:
> If 'dlpar_configure_connector()' fails, 'parent_dn' should be released as
> already done in the normal case.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>  arch/powerpc/platforms/pseries/mobility.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> index 5a0c7ba429ce..b8060c182ae2 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -226,13 +226,16 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
>  		return -ENOENT;
> 
>  	dn = dlpar_configure_connector(drc_index, parent_dn);

Simpler approach would be to move the of_node_put() call to here
directly after the last use of parent_dn.

-Tyrel

> -	if (!dn)
> -		return -ENOENT;
> +	if (!dn) {
> +		rc = -ENOENT;
> +		goto out;
> +	}
> 
>  	rc = dlpar_attach_node(dn);
>  	if (rc)
>  		dlpar_free_cc_nodes(dn);
> 
> +out:
>  	of_node_put(parent_dn);
>  	return rc;
>  }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ