From: Maxim Levitsky <maximlevitsky@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: enh@google.com, David Woodhouse <dwmw2@infradead.org>,
Maxim Levitsky <maximlevitsky@gmail.com>,
nnk@google.com
Subject: [PATCH] MTD: FTL layer: don't free input argument in add_mtd_blktrans_dev
Date: Sun, 9 Jan 2011 01:25:06 +0200 [thread overview]
Message-ID: <1294529106-32586-1-git-send-email-maximlevitsky@gmail.com> (raw)
This one liner patch fixes double free that will occur if add_mtd_blktrans_dev
fails. On failure it free 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
Signed-of-by: Maxim Levitsky <maximlevitsky@gmail.com>
CC: nnk@google.com
CC: enh@google.com
---
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 cb20c67..e0a2373 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;
}
--
1.7.1
next reply other threads:[~2011-01-08 23:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-08 23:25 Maxim Levitsky [this message]
2011-01-18 8:32 ` [PATCH] MTD: FTL layer: don't free input argument in add_mtd_blktrans_dev Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294529106-32586-1-git-send-email-maximlevitsky@gmail.com \
--to=maximlevitsky@gmail.com \
--cc=dwmw2@infradead.org \
--cc=enh@google.com \
--cc=linux-mtd@lists.infradead.org \
--cc=nnk@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.