ext4: add ext4_mb_unload_buddy in the error path

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
This commit is contained in:
Salman Qazi 2012-05-31 23:51:27 -04:00 committed by Theodore Ts'o
parent 79906964a1
commit 02b7831019
1 changed files with 1 additions and 0 deletions

View File

@ -4634,6 +4634,7 @@ do_more:
*/
new_entry = kmem_cache_alloc(ext4_free_data_cachep, GFP_NOFS);
if (!new_entry) {
ext4_mb_unload_buddy(&e4b);
err = -ENOMEM;
goto error_return;
}