diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2011-01-09 00:25:06 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-03-11 15:19:44 +0100 |
commit | bd637f6f22235b4613f9ab6555e8088a455c1ed4 (patch) | |
tree | 3892841ec4fd7bbf0ceffad2e594830b554d0f34 /drivers/mtd/mtd_blkdevs.c | |
parent | mtd: amd76xrom: fix oops at boot when resources are not available (diff) | |
download | linux-bd637f6f22235b4613f9ab6555e8088a455c1ed4.tar.xz linux-bd637f6f22235b4613f9ab6555e8088a455c1ed4.zip |
mtd: mtd_blkdevs: fix double free on error path
This one liner patch fixes double free that will occur if add_mtd_blktrans_dev
fails. On failure it frees the input argument, but all its users also free it
on error which is natural thing to do. Thus don't free it.
All credit for finding that bug belongs to reporters of the bug in the android bugzilla
http://code.google.com/p/android/issues/detail?id=13761
Commit message tweaked by Artem.
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index cb20c67995d8..e0a2373bf0e2 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -413,7 +413,6 @@ error3: error2: list_del(&new->list); error1: - kfree(new); return ret; } |