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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 22 May 2013 16:06:28 +1000
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Libo Chen <clbchenlibo.chen@...wei.com>
Cc:	vinod.koul@...el.com, grant.likely@...aro.org,
	rob.herring@...xeda.com, Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, devicetree-discuss@...ts.ozlabs.org,
	Libo Chen <libo.chen@...wei.com>, agust@...x.de,
	phdm@...qel.be, Li Zefan <lizefan@...wei.com>
Subject: Re: [PATCH] bestcomm: no need to free when kzalloc fail

On Wed, 2013-05-22 at 12:49 +0800, Libo Chen wrote:
> ping...

This is pointless. We routinely avoid adding such crap by having
the various free(...) routines cope with NULL. You just need to make
sure you are indeed NULL in the error case.

Ben.

> On 2013/5/5 16:38, chenlibo.3@...il.com wrote:
> > From: Libo Chen <libo.chen@...wei.com>
> > 
> > There is no need to free bcom_eng if kzalloc fail
> > 
> > Signed-off-by: Libo Chen <libo.chen@...wei.com>
> > ---
> >  drivers/dma/bestcomm/bestcomm.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c
> > index a8c2e29..300ee2d 100644
> > --- a/drivers/dma/bestcomm/bestcomm.c
> > +++ b/drivers/dma/bestcomm/bestcomm.c
> > @@ -400,7 +400,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op)
> >  		printk(KERN_ERR DRIVER_NAME ": "
> >  			"Can't allocate state structure\n");
> >  		rv = -ENOMEM;
> > -		goto error_sramclean;
> > +		goto error_kzalloc;
> >  	}
> >  
> >  	/* Save the node */
> > @@ -449,6 +449,7 @@ error_release:
> >  	release_mem_region(res_bcom.start, sizeof(struct mpc52xx_sdma));
> >  error_sramclean:
> >  	kfree(bcom_eng);
> > +error_kzalloc:
> >  	bcom_sram_cleanup();
> >  error_ofput:
> >  	of_node_put(op->dev.of_node);
> > 
> 


--
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