From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>,
Eric Miao <eric.y.miao@gmail.com>,
Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-mtd@lists.infradead.org
Subject: [PATCH 1/2] mtd: pxa3xx_nand: fix a memory leak
Date: Fri, 03 Jun 2011 13:14:10 +0800 [thread overview]
Message-ID: <1307078050.4167.1.camel@phoenix> (raw)
In pxa3xx_nand_remove, we should call nand_release instead of
mtd_device_unregister to properly free bad block table memory
and bad block descriptor memory.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/mtd/nand/pxa3xx_nand.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 1fb3b3a..f7040ea 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1119,7 +1119,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
clk_put(info->clk);
if (mtd) {
- mtd_device_unregister(mtd);
+ nand_release(mtd);
kfree(mtd);
}
return 0;
--
1.7.4.1
next reply other threads:[~2011-06-03 5:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-03 5:14 Axel Lin [this message]
2011-06-03 5:15 ` [PATCH 2/2] mtd: fsmc_nand: fix a memory leak Axel Lin
2011-06-03 13:02 ` [PATCH 1/2] mtd: pxa3xx_nand: " Daniel Mack
2011-06-03 15:58 ` Lei Wen
2011-06-06 10:19 ` 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=1307078050.4167.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=dwmw2@infradead.org \
--cc=eric.y.miao@gmail.com \
--cc=haojian.zhuang@marvell.com \
--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