linux/drivers/mtd/devices
H Hartley Sweeten d4702669b0 mtd: fix memory leak in mtd_dataflash
Fix a potential memory leak in mtd_dataflash driver.

The private data that is allocated when registering a DataFlash
device with the MTD subsystem is not released if an error occurs
when add_mtd_partitions() or add_mtd_device() is called.  Fix this
by adding an error path.  The memory is already released during a
remove.

Also, add a dev_set_drvdata(&spi->dev, NULL) before the kfree() so
that the spi device does not reference invalid data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-10-17 15:41:11 +01:00
..
Kconfig mtd: SST25L (non JEDEC) SPI Flash driver 2009-09-19 10:54:45 -07:00
Makefile mtd: SST25L (non JEDEC) SPI Flash driver 2009-09-19 10:54:45 -07:00
block2mtd.c
doc2000.c
doc2001.c
doc2001plus.c
docecc.c
docprobe.c
lart.c mtd: lart: Prevent a read from mtd->eraseregions[-1] 2009-09-19 11:18:15 -07:00
m25p80.c mtd: m25p80: disable SST software protection bits by default 2009-09-24 12:52:29 -07:00
ms02-nv.c
ms02-nv.h
mtd_dataflash.c mtd: fix memory leak in mtd_dataflash 2009-10-17 15:41:11 +01:00
mtdram.c
phram.c phram: cleanup error handling and associated messages 2009-09-19 13:11:12 -07:00
pmc551.c
slram.c Merge git://git.infradead.org/mtd-2.6 2009-09-23 10:07:49 -07:00
sst25l.c mtd: sst25l, fix lock imbalance 2009-09-19 10:56:53 -07:00