From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] mtd: pxa3xx_nand: fix a memory leak
Date: Mon, 7 Nov 2011 16:43:28 +0100 [thread overview]
Message-ID: <1320680611-29448-2-git-send-email-zonque@gmail.com> (raw)
In-Reply-To: <1320680611-29448-1-git-send-email-zonque@gmail.com>
From: Axel Lin <axel.lin@gmail.com>
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>
Acked-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.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.6.4
next prev parent reply other threads:[~2011-11-07 15:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 15:43 [PATCH 0/4] Re-sending pxa3xx nand controller patches Daniel Mack
2011-11-07 15:43 ` Daniel Mack [this message]
2011-11-07 15:43 ` [PATCH 2/4] mtd: pxa3xx_nand: remove unused variable 'mtd' Daniel Mack
2011-11-07 15:43 ` [PATCH 3/4] mtd: pxa3xx_nand: fix nand detection issue Daniel Mack
2011-11-07 15:43 ` [PATCH 4/4] mtd: pxa3xx_nand: Fix blank page ECC mismatch Daniel Mack
2011-11-17 21:15 ` [PATCH 0/4] Re-sending pxa3xx nand controller patches 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=1320680611-29448-2-git-send-email-zonque@gmail.com \
--to=zonque@gmail.com \
--cc=linux-arm-kernel@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).