alistair23-linux/drivers/mtd/devices
Jesper Juhl 4f678a58d3 mtd: fix memory leaks in phram_setup
There are two code paths in drivers/mtd/devices/phram.c::phram_setup() that
will leak memory.
Memory is allocated to the variable 'name' with kmalloc() by the
parse_name() function, but if we leave by way of the parse_err() macro,
then that memory is never kfree()'d, nor is it ever used with
register_device() so it won't be freed later either - leak.

Found by the Coverity checker as #593 - simple fix below.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 00:13:30 +01:00
..
block2mtd.c mtd: improve parameter parsing for block2mtd 2006-04-19 09:10:06 +01:00
doc2000.c Remove inter_module_xxx() from DiskOnChip drivers. 2006-05-08 14:05:05 +01:00
doc2001.c [MTD] Fix capitalisation in export of old doc2001.c initfunc 2006-05-12 11:40:13 +01:00
doc2001plus.c [MTD] Fix capitalisation in export of DiskOnChip Millennium initfunc 2006-05-10 16:16:13 +01:00
docecc.c [MTD] devices: Clean up trailing white spaces 2005-11-07 15:06:59 +01:00
docprobe.c Fix non-modular case for DiskOnChip probe 2006-05-08 17:10:11 +01:00
Kconfig Remove inter_module_xxx() from DiskOnChip drivers. 2006-05-08 14:05:05 +01:00
lart.c [PATCH] drivers/mtd: Use ARRAY_SIZE macro 2006-03-31 12:18:48 -08:00
m25p80.c [PATCH] MTD: m25p80: fix printk format warning 2006-04-11 20:05:20 -04:00
Makefile Remove inter_module_xxx() from DiskOnChip drivers. 2006-05-08 14:05:05 +01:00
ms02-nv.c [PATCH] drivers/mtd: Use ARRAY_SIZE macro 2006-03-31 12:18:48 -08:00
ms02-nv.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mtd_dataflash.c [PATCH] mtd_dataflash, fix block vs page erase 2006-03-14 07:57:17 -08:00
mtdram.c [PATCH] vfree and kfree cleanup in drivers/ 2005-09-10 10:06:30 -07:00
phram.c mtd: fix memory leaks in phram_setup 2006-05-14 00:13:30 +01:00
pmc551.c [PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reason 2005-11-09 07:55:57 -08:00
slram.c Remove unchecked MTD flags 2006-04-17 15:48:17 +01:00