Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b72143ab authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ext4: Add error checking to kmem_cache_alloc() call in ext4_free_blocks()



Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 0ff2ea7d
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -4627,6 +4627,10 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
		 * be used until this transaction is committed
		 * 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->start_blk = bit;
		new_entry->group  = block_group;
		new_entry->group  = block_group;
		new_entry->count = count;
		new_entry->count = count;