summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-12-10 09:56:01 -0500
committerBen Hutchings <ben@decadent.org.uk>2017-03-16 02:26:33 +0000
commit88cf7e158fecf8a80ef83371d9e273151fa85b28 (patch)
tree606e80c1735e5820a2e8f404482355786b5b1893 /fs/ext4
parent1bd9b8e017f73f41588348a947bd7e81f93b3da3 (diff)
downloadlinux-stable-88cf7e158fecf8a80ef83371d9e273151fa85b28.tar.gz
linux-stable-88cf7e158fecf8a80ef83371d9e273151fa85b28.tar.bz2
linux-stable-88cf7e158fecf8a80ef83371d9e273151fa85b28.zip
ext4: return -ENOMEM instead of success
commit 578620f451f836389424833f1454eeeb2ffc9e9f upstream. We should set the error code if kzalloc() fails. Fixes: 67cf5b09a46f ("ext4: add the basic function for inline data support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 7af6a3dcbb1f..7bd13f3d1790 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -340,8 +340,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);