From: Ingo van Lil Date: Mon, 24 Mar 2008 19:29:44 +0000 (-0700) Subject: mtd: memory corruption in block2mtd.c X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2875fb65f8e40401c4b781ebc5002df10485f635;p=openwrt%2Fstaging%2Fblogic.git 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 Acked-by: Joern Engel Cc: David Woodhouse Cc: Cc: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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"); } }