[PATCH] NAND Flash support for Intel IXP4xx platform

Ruslan V. Sushko rsushko at ru.mvista.com
Tue Apr 24 04:29:12 EDT 2007


Vitaly Wool wrote:
>> >> +
>> >> +    /* Register the partitions */
>> >> +    err = add_mtd_partitions(ixp4xx_mtd, ixp4xx_nand_parts,
>> >> nb_of_parts);
>> >> +    if (err)  {
>> >> +        printk(KERN_ERR "Failed to add MTD partitions\n");
>> >> +        if ( ixp4xx_nand_parts != plat->parts )
>> >> +        kfree(ixp4xx_nand_parts);
>> >>
>> > Wrong indentation.
>> > Moreover, if the number of partitions obtained by parse_mtd_partitions
>> > is the same as the one provided by platform data, you'll get leakage
>> > here.
>> how this can happens? Please describe.
>
> Suppose that the number of partitions obtained by parse_mtd_partitions
> is the same as configured statically. If add_mtd_partitions fails,
> ixp4xx_nand_parts != plat->parts is false and kfree won't be called.
>
> Vitaly
It's impossible because ixp4xx_nand_parts and plat->parts hold pointers 
to mtd_partions structure, not number of partions. Number of partitions 
held in nb_of_parts variable.

Thank you,
Ruslan




More information about the linux-mtd mailing list