Skip to content

Commit

Permalink
ext4: return -ENOMEM instead of success
Browse files Browse the repository at this point in the history
We should set the error code if kzalloc() fails.

Fixes: 67cf5b0 ("ext4: add the basic function for inline data support")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: [email protected]
  • Loading branch information
Dan Carpenter authored and tytso committed Dec 10, 2016
1 parent 7e6e1ef commit 578620f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ext4/inline.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,10 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode,

len -= EXT4_MIN_INLINE_DATA_SIZE;
value = kzalloc(len, GFP_NOFS);
if (!value)
if (!value) {
error = -ENOMEM;
goto out;
}

error = ext4_xattr_ibody_get(inode, i.name_index, i.name,
value, len);
Expand Down

0 comments on commit 578620f

Please sign in to comment.