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:	Fri, 3 Jun 2011 23:58:03 +0800
From:	Lei Wen <adrian.wenl@...il.com>
To:	Daniel Mack <zonque@...il.com>
Cc:	Axel Lin <axel.lin@...il.com>, linux-kernel@...r.kernel.org,
	Haojian Zhuang <haojian.zhuang@...vell.com>,
	Eric Miao <eric.y.miao@...il.com>,
	Artem Bityutskiy <Artem.Bityutskiy@...ia.com>,
	David Woodhouse <dwmw2@...radead.org>,
	linux-mtd@...ts.infradead.org
Subject: Re: [PATCH 1/2] mtd: pxa3xx_nand: fix a memory leak

On Fri, Jun 3, 2011 at 9:02 PM, Daniel Mack <zonque@...il.com> wrote:
> (Cc Lei Wen)
>
> On Fri, Jun 3, 2011 at 7:14 AM, Axel Lin <axel.lin@...il.com> wrote:
>> In pxa3xx_nand_remove, we should call nand_release instead of
>> mtd_device_unregister to properly free bad block table memory
>> and bad block descriptor memory.
>>
>> Signed-off-by: Axel Lin <axel.lin@...il.com>
>> ---
>>  drivers/mtd/nand/pxa3xx_nand.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
>> index 1fb3b3a..f7040ea 100644
>> --- a/drivers/mtd/nand/pxa3xx_nand.c
>> +++ b/drivers/mtd/nand/pxa3xx_nand.c
>> @@ -1119,7 +1119,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
>>        clk_put(info->clk);
>>
>>        if (mtd) {
>> -               mtd_device_unregister(mtd);
>> +               nand_release(mtd);
>>                kfree(mtd);
>>        }
>>        return 0;
>> --
>> 1.7.4.1
>>

Acked-by: Lei Wen <leiwen@...vell.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