summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2009-10-07 17:08:08 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-10-17 15:41:11 +0100
commitd4702669b0b64b8fa7c91123639ec20d9592ee43 (patch)
treea5f0be652b0a21b52194814de874a91d5cbe0358 /Documentation
parentf54d6336372b97d3624d1c5c179b2dd062472bd1 (diff)
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 'Documentation')
0 files changed, 0 insertions, 0 deletions