summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/Makefile
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2009-10-07 23:08:08 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-10-17 16:41:11 +0200
commitd4702669b0b64b8fa7c91123639ec20d9592ee43 (patch)
treea5f0be652b0a21b52194814de874a91d5cbe0358 /drivers/mtd/maps/Makefile
parentmtd: cleanup mtd_oobtest (diff)
downloadlinux-d4702669b0b64b8fa7c91123639ec20d9592ee43.tar.xz
linux-d4702669b0b64b8fa7c91123639ec20d9592ee43.zip
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>
Diffstat (limited to 'drivers/mtd/maps/Makefile')
0 files changed, 0 insertions, 0 deletions