From: Chen Gang <gang.chen@asianux.com>
To: akpm@linux-foundation.org, jack@suse.cz
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH] fs/jbd: set pointer = NULL, after kfree it.
Date: Mon, 24 Dec 2012 10:39:07 +0800 [thread overview]
Message-ID: <50D7C04B.6010109@asianux.com> (raw)
set pointer = NULL, after call journal_destroy_revoke_table.
in journal_destroy_revoke_table, it will call kfree to free the buffer.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
fs/jbd/revoke.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 25c713e..d6457b0 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -295,6 +295,7 @@ int journal_init_revoke(journal_t *journal, int hash_size)
fail1:
journal_destroy_revoke_table(journal->j_revoke_table[0]);
+ journal->j_revoke_table[0] = NULL;
fail0:
return -ENOMEM;
}
@@ -303,10 +304,14 @@ fail0:
void journal_destroy_revoke(journal_t *journal)
{
journal->j_revoke = NULL;
- if (journal->j_revoke_table[0])
+ if (journal->j_revoke_table[0]) {
journal_destroy_revoke_table(journal->j_revoke_table[0]);
- if (journal->j_revoke_table[1])
+ journal->j_revoke_table[0] = NULL;
+ }
+ if (journal->j_revoke_table[1]) {
journal_destroy_revoke_table(journal->j_revoke_table[1]);
+ journal->j_revoke_table[1] = NULL;
+ }
}
--
1.7.10.4
next reply other threads:[~2012-12-24 2:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-24 2:39 Chen Gang [this message]
2012-12-31 15:23 ` [PATCH] fs/jbd: set pointer = NULL, after kfree it Jan Kara
-- strict thread matches above, loose matches on Subject: below --
2013-01-04 1:37 Chen Gang
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=50D7C04B.6010109@asianux.com \
--to=gang.chen@asianux.com \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.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 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.