summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/block2mtd.c
diff options
context:
space:
mode:
authorIngo van Lil <inguin@gmx.de>2008-03-24 20:29:44 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-25 03:22:19 +0100
commit2875fb65f8e40401c4b781ebc5002df10485f635 (patch)
treefe111c02b7aa2c943e7f824aadd6e7fa06da3d0f /drivers/mtd/devices/block2mtd.c
parentkernel-parameters.txt: document memmap option better (diff)
downloadlinux-2875fb65f8e40401c4b781ebc5002df10485f635.tar.xz
linux-2875fb65f8e40401c4b781ebc5002df10485f635.zip
mtd: memory corruption in block2mtd.c
The block2mtd driver (drivers/mtd/devices/block2mtd.c) will kfree an on-stack pointer when handling an invalid argument line (e.g. block2mtd=/dev/loop0,xxx). The kfree was added some time ago when "name" was dynamically allocated. Signed-off-by: Ingo van Lil <inguin@gmx.de> Acked-by: Joern Engel <joern@lazybastard.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: <stable@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mtd/devices/block2mtd.c')
-rw-r--r--drivers/mtd/devices/block2mtd.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index eeaaa9dce6ef..ad1880c67518 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -408,7 +408,6 @@ static int block2mtd_setup2(const char *val)
if (token[1]) {
ret = parse_num(&erase_size, token[1]);
if (ret) {
- kfree(name);
parse_err("illegal erase size");
}
}