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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Aug 2014 12:56:36 +1000
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Julia Lawall <Julia.Lawall@...6.fr>
Cc:	kernel-janitors@...r.kernel.org, Paul Mackerras <paulus@...ba.org>,
	Michael Ellerman <mpe@...erman.id.au>,
	linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	Uwe Kleine-K├Ânig 
	<u.kleine-koenig@...gutronix.de>
Subject: Re: [PATCH 7/14] cpu: delete unneeded test before of_node_put

On Fri, 2014-08-08 at 12:07 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@...6.fr>
> 
> Simplify the error path to avoid calling of_node_put when it is not needed.
> 
> The semantic patch that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)

Change the subject to powerpc/4xx/cpm or something like that,
appart from that:

Acked-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>

> 
> // <smpl>
> @@
> expression e;
> @@
> 
> -if (e)
>    of_node_put(e);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
> 
> ---
>  arch/powerpc/sysdev/ppc4xx_cpm.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/ppc4xx_cpm.c b/arch/powerpc/sysdev/ppc4xx_cpm.c
> index 82e2cfe..ba95adf 100644
> --- a/arch/powerpc/sysdev/ppc4xx_cpm.c
> +++ b/arch/powerpc/sysdev/ppc4xx_cpm.c
> @@ -281,7 +281,7 @@ static int __init cpm_init(void)
>  		printk(KERN_ERR "cpm: could not parse dcr property for %s\n",
>  		       np->full_name);
>  		ret = -EINVAL;
> -		goto out;
> +		goto node_put;
>  	}
>  
>  	cpm.dcr_host = dcr_map(np, dcr_base, dcr_len);
> @@ -290,7 +290,7 @@ static int __init cpm_init(void)
>  		printk(KERN_ERR "cpm: failed to map dcr property for %s\n",
>  		       np->full_name);
>  		ret = -EINVAL;
> -		goto out;
> +		goto node_put;
>  	}
>  
>  	/* All 4xx SoCs with a CPM controller have one of two
> @@ -330,9 +330,9 @@ static int __init cpm_init(void)
>  
>  	if (cpm.standby || cpm.suspend)
>  		suspend_set_ops(&cpm_suspend_ops);
> +node_put:
> +	of_node_put(np);
>  out:
> -	if (np)
> -		of_node_put(np);
>  	return ret;
>  }
>  


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists