summaryrefslogtreecommitdiff
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-12-20 12:26:59 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2010-12-20 12:26:59 (GMT)
commitb72143ab3ed566a12560fa4411a1f02c276dcc39 (patch)
tree8a4ad3ee044ca2c398fc769973bebfa0b721fca6 /fs/ext4/mballoc.c
parent0ff2ea7d84e31176a046a1eabea59d6e4eecd998 (diff)
downloadlinux-b72143ab3ed566a12560fa4411a1f02c276dcc39.tar.xz
ext4: Add error checking to kmem_cache_alloc() call in ext4_free_blocks()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 731b6f7..46d5414 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4626,7 +4626,11 @@ do_more:
* blocks being freed are metadata. these blocks shouldn't
* be used until this transaction is committed
*/
- new_entry = kmem_cache_alloc(ext4_free_ext_cachep, GFP_NOFS);
+ new_entry = kmem_cache_alloc(ext4_free_ext_cachep, GFP_NOFS);
+ if (!new_entry) {
+ err = -ENOMEM;
+ goto error_return;
+ }
new_entry->start_blk = bit;
new_entry->group = block_group;
new_entry->count = count;