[PATCH] NAND Flash support for Intel IXP4xx platform

Vitaly Wool vitalywool at gmail.com
Tue Apr 24 03:21:52 EDT 2007


> > What the initialization to {0, NULL} is for?
> just through habit. What's wrong here?
It's just useless.

> >> +
> >> +    /* 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




More information about the linux-mtd mailing list