lkml.org 
[lkml]   [2003]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [CHECKER] 32 Memory Leaks on Error Paths
On Tue, 16 September 2003 08:55:53 +0200, Jörn Engel wrote:
> On Mon, 15 September 2003 21:35:46 -0700, David Yu Chen wrote:
> >
> > [FILE: 2.6.0-test5/drivers/mtd/chips/cfi_cmdset_0020.c]
> > [FUNC: cfi_staa_setup]
> > [LINES: 191-211]
> > [VAR: mtd]
> > 186: struct mtd_info *mtd;
> > 187: unsigned long offset = 0;
> > 188: int i,j;
> > 189: unsigned long devsize = (1<<cfi->cfiq->DevSize) * cfi->interleave;
> > 190:
> > START -->
> > 191: mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
> > 192: //printk(KERN_DEBUG "number of CFI chips: %d\n", cfi->numchips);
> > 193:
> > 194: if (!mtd) {
> > 195: printk(KERN_ERR "Failed to allocate memory for MTD device\n");
> > 196: kfree(cfi->cmdset_priv);
> > ... DELETED 9 lines ...
> > 206: mtd->eraseregions = kmalloc(sizeof(struct mtd_erase_region_info)
> > 207: * mtd->numeraseregions, GFP_KERNEL);
> > 208: if (!mtd->eraseregions) {
> > 209: printk(KERN_ERR "Failed to allocate memory for MTD erase region info\n");
> > 210: kfree(cfi->cmdset_priv);
> > END -->
> > 211: return NULL;
> > 212: }
> > 213:
> > 214: for (i=0; i<cfi->cfiq->NumEraseRegions; i++) {
> > 215: unsigned long ernum, ersize;
> > 216: ersize = ((cfi->cfiq->EraseRegionInfo[i] >> 8) & ~0xff) * cfi->interleave;
>
> Valid.

This should be fixed by finally taking the time and merging the
command sets 0001 and 0020. Maybe someone who cares will come up with
a patch.

Jörn

--
Simplicity is prerequisite for reliability.
-- Edsger W. Dijkstra
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.222 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site