]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: mtd_blkdevs: fix double free on error path
authorMaxim Levitsky <maximlevitsky@gmail.com>
Sat, 8 Jan 2011 23:25:06 +0000 (01:25 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Mar 2011 14:19:44 +0000 (14:19 +0000)
commitb97d04063c13532a074e76aca2f19708cd31dd21
tree3892841ec4fd7bbf0ceffad2e594830b554d0f34
parent4cffc0635ea10ad35bfb96859fe799293946b8eb
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
drivers/mtd/mtd_blkdevs.c