[PATCH 1/2] mtd: pxa3xx_nand: fix a memory leak

Lei Wen adrian.wenl at gmail.com
Fri Jun 3 11:58:03 EDT 2011


On Fri, Jun 3, 2011 at 9:02 PM, Daniel Mack <zonque at gmail.com> wrote:
> (Cc Lei Wen)
>
> On Fri, Jun 3, 2011 at 7:14 AM, Axel Lin <axel.lin at gmail.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 at gmail.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 at marvell.com>



More information about the linux-mtd mailing list