Skip to content

Commit

Permalink
ext4: add ext4_mb_unload_buddy in the error path
Browse files Browse the repository at this point in the history
ext4_free_blocks fails to pair an ext4_mb_load_buddy with a matching
ext4_mb_unload_buddy when it fails a memory allocation.

Signed-off-by: Salman Qazi <sqazi@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
  • Loading branch information
Salman Qazi authored and Theodore Ts'o committed Jun 1, 2012
1 parent 7990696 commit 02b7831
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4634,6 +4634,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
*/
new_entry = kmem_cache_alloc(ext4_free_data_cachep, GFP_NOFS);
if (!new_entry) {
ext4_mb_unload_buddy(&e4b);
err = -ENOMEM;
goto error_return;
}
Expand Down

0 comments on commit 02b7831

Please sign in to comment.