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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <129600E5E5FB004392DDC3FB599660D7CB370DD6@irsmsx504.ger.corp.intel.com>
Date:	Wed, 23 Dec 2009 15:08:11 +0000
From:	"Sosnowski, Maciej" <maciej.sosnowski@...el.com>
To:	Julia Lawall <julia@...u.dk>
CC:	"Williams, Dan J" <dan.j.williams@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH 2/2] drivers/dma: drop unnecesary memset

Julia Lawall wrote:
> From: Julia Lawall <julia@...u.dk>
> 
> memset of 0 is not needed after kzalloc
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression x;
> statement S;
> @@
> 
> x = kzalloc(...);
> if (x == NULL) S
> ... when != x
> -memset(x,0,...);// </smpl>
> 
> Signed-off-by: Julia Lawall <julia@...u.dk>
> 
> ---
>  drivers/dma/dw_dmac.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff -u -p a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -1270,8 +1270,6 @@ static int __init dw_probe(struct platfo
>  		goto err_kfree;
>  	}
> 
> -	memset(dw, 0, sizeof *dw);
> -
>  	dw->regs = ioremap(io->start, DW_REGLEN);
>  	if (!dw->regs) {
>  		err = -ENOMEM;

Acked-by: Maciej Sosnowski <maciej.sosnowski@...el.com>--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ