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]
Date:	Wed, 10 Aug 2011 08:11:56 +0200 (CEST)
From:	Julia Lawall <julia@...u.dk>
To:	Ryan Mallon <rmallon@...il.com>
Cc:	Jiandong Zheng <jdzheng@...adcom.com>,
	kernel-janitors@...r.kernel.org,
	Scott Branden <sbranden@...adcom.com>,
	David Woodhouse <dwmw2@...radead.org>,
	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/mtd/nand/bcm_umi_nand.c: add missing kfree/ioremap

On Wed, 10 Aug 2011, Ryan Mallon wrote:

> On 10/08/11 15:42, Julia Lawall wrote:
> > From: Julia Lawall<julia@...u.dk>
> >
> > The error handling code under the #if should be the same as elsewhere in
> > the function.
> >
> > Signed-off-by: Julia Lawall<julia@...u.dk>
> >
> > ---
> >   drivers/mtd/nand/bcm_umi_nand.c |    5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/nand/bcm_umi_nand.c
> > b/drivers/mtd/nand/bcm_umi_nand.c
> > index a8ae898..72e8ec2 100644
> > --- a/drivers/mtd/nand/bcm_umi_nand.c
> > +++ b/drivers/mtd/nand/bcm_umi_nand.c
> > @@ -433,8 +433,11 @@ static int __devinit bcm_umi_nand_probe(struct
> platform_device *pdev)
> >
> >   #if USE_DMA
> >   	err = nand_dma_init();
> > -	if (err != 0)
> > +	if (err != 0) {
> > +		iounmap(bcm_umi_io_base);
> > +		kfree(board_mtd);
> >   		return err;
> > +	}
> >   #endif
> 
> This probe function should possibly use goto exits on failure. It reduces a
> bit of code duplication and helps prevent this type of error.

OK, I didn't want to make such a major change for only one new case.  But 
since there are three new cases, I will do that.

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