Commit 40fb8cb8 authored by Salman Qazi's avatar Salman Qazi Committed by Ben Hutchings

ext4: add ext4_mb_unload_buddy in the error path

commit 02b78310 upstream.

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: default avatarSalman Qazi <sqazi@google.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent f139d067
......@@ -4693,6 +4693,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
*/
new_entry = kmem_cache_alloc(ext4_free_ext_cachep, GFP_NOFS);
if (!new_entry) {
ext4_mb_unload_buddy(&e4b);
err = -ENOMEM;
goto error_return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment