From: Nilanjan Roychowdhury <nilanjan.roychowdhury@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>, linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org,
Nilanjan Roychowdhury <nilanjan.roychowdhury@gmail.com>
Subject: [PATCH 1/1] mtd: mtdoops: fix for a potential memory leak in mtdoops_notify_remove
Date: Sun, 11 Aug 2013 13:11:48 -0700 [thread overview]
Message-ID: <1376251908-7451-1-git-send-email-nilanjan.roychowdhury@gmail.com> (raw)
we are allocating cxt->oops_page_used using vmalloc in mtdoops_notify_add for
every mtd_info addition but not freeing it in mtdoops_notify_remove
Signed-off-by: Nilanjan Roychowdhury <nilanjan.roychowdhury@gmail.com>
---
drivers/mtd/mtdoops.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 97bb8f6..02f49aa 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -386,6 +386,7 @@ static void mtdoops_notify_remove(struct mtd_info *mtd)
cxt->mtd = NULL;
flush_work(&cxt->work_erase);
flush_work(&cxt->work_write);
+ vfree(cxt->oops_page_used);
}
--
1.7.9.5
next reply other threads:[~2013-08-11 20:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-11 20:11 Nilanjan Roychowdhury [this message]
2013-08-12 17:26 ` [PATCH 1/1] mtd: mtdoops: fix for a potential memory leak in mtdoops_notify_remove Ezequiel Garcia
2013-08-13 4:11 ` Nilanjan Roychowdhury
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=1376251908-7451-1-git-send-email-nilanjan.roychowdhury@gmail.com \
--to=nilanjan.roychowdhury@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).