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@xxxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html