diff options
Diffstat (limited to 'fs/jbd/transaction.c')
-rw-r--r-- | fs/jbd/transaction.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index c609f5034fcd..508b2ea91f43 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c | |||
@@ -227,7 +227,8 @@ repeat_locked: | |||
227 | spin_unlock(&transaction->t_handle_lock); | 227 | spin_unlock(&transaction->t_handle_lock); |
228 | spin_unlock(&journal->j_state_lock); | 228 | spin_unlock(&journal->j_state_lock); |
229 | out: | 229 | out: |
230 | kfree(new_transaction); | 230 | if (unlikely(new_transaction)) /* It's usually NULL */ |
231 | kfree(new_transaction); | ||
231 | return ret; | 232 | return ret; |
232 | } | 233 | } |
233 | 234 | ||
@@ -724,7 +725,8 @@ done: | |||
724 | journal_cancel_revoke(handle, jh); | 725 | journal_cancel_revoke(handle, jh); |
725 | 726 | ||
726 | out: | 727 | out: |
727 | kfree(frozen_buffer); | 728 | if (unlikely(frozen_buffer)) /* It's usually NULL */ |
729 | kfree(frozen_buffer); | ||
728 | 730 | ||
729 | JBUFFER_TRACE(jh, "exit"); | 731 | JBUFFER_TRACE(jh, "exit"); |
730 | return error; | 732 | return error; |
@@ -903,7 +905,8 @@ repeat: | |||
903 | jbd_unlock_bh_state(bh); | 905 | jbd_unlock_bh_state(bh); |
904 | out: | 906 | out: |
905 | journal_put_journal_head(jh); | 907 | journal_put_journal_head(jh); |
906 | kfree(committed_data); | 908 | if (unlikely(committed_data)) |
909 | kfree(committed_data); | ||
907 | return err; | 910 | return err; |
908 | } | 911 | } |
909 | 912 | ||
@@ -2038,7 +2041,8 @@ void __journal_refile_buffer(struct journal_head *jh) | |||
2038 | __journal_temp_unlink_buffer(jh); | 2041 | __journal_temp_unlink_buffer(jh); |
2039 | jh->b_transaction = jh->b_next_transaction; | 2042 | jh->b_transaction = jh->b_next_transaction; |
2040 | jh->b_next_transaction = NULL; | 2043 | jh->b_next_transaction = NULL; |
2041 | __journal_file_buffer(jh, jh->b_transaction, BJ_Metadata); | 2044 | __journal_file_buffer(jh, jh->b_transaction, |
2045 | was_dirty ? BJ_Metadata : BJ_Reserved); | ||
2042 | J_ASSERT_JH(jh, jh->b_transaction->t_state == T_RUNNING); | 2046 | J_ASSERT_JH(jh, jh->b_transaction->t_state == T_RUNNING); |
2043 | 2047 | ||
2044 | if (was_dirty) | 2048 | if (was_dirty) |