From 5f30d7964f3ec5606ba254b5fd93ea476b02ec87 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 10 Dec 2016 17:51:18 -0500 Subject: [PATCH] add patch return-enomem-instead-of-success --- return-enomem-instead-of-success | 28 ++++++++++++++++++++++++++++ series | 1 + timestamps | 7 ++++--- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 return-enomem-instead-of-success diff --git a/return-enomem-instead-of-success b/return-enomem-instead-of-success new file mode 100644 index 00000000..22be0a92 --- /dev/null +++ b/return-enomem-instead-of-success @@ -0,0 +1,28 @@ +ext4: return -ENOMEM instead of success + +From: Dan Carpenter + +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 +Signed-off-by: Theodore Ts'o +Cc: stable@vger.kernel.org +--- +diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c +index 9b67f75bdcf7..437df6a1a841 100644 +--- a/fs/ext4/inline.c ++++ b/fs/ext4/inline.c +@@ -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); + diff --git a/series b/series index ad99e11d..24797a97 100644 --- a/series +++ b/series @@ -61,6 +61,7 @@ fix-checks-for-data-ordered-and-journal_async_commit-options fix-block_validity-documentation remove-another-test-in-ext4_alloc_file_blocks reject-inodes-with-negative-size +return-enomem-instead-of-success #################################################### # unstable patches diff --git a/timestamps b/timestamps index 27f9d383..ac718c9a 100755 --- a/timestamps +++ b/timestamps @@ -97,7 +97,8 @@ touch -d @1480798501 mbcache-document-that-find-functions-only-return-reusable-e touch -d @1480800053 fix-checks-for-data-ordered-and-journal_async_commit-options touch -d @1480801485 fix-block_validity-documentation touch -d @1480801618 remove-another-test-in-ext4_alloc_file_blocks -touch -d @1481381002 series touch -d @1481381701 reject-inodes-with-negative-size -touch -d @1481381701 status -touch -d @1481381851 timestamps +touch -d @1481381761 return-enomem-instead-of-success +touch -d @1481381885 series +touch -d @1481381892 status +touch -d @1481410266 timestamps -- 2.11.4.GIT