From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:55351 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235AbdAMHoD (ORCPT ); Fri, 13 Jan 2017 02:44:03 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: Dan Carpenter , Theodore Ts'o , Jiri Slaby Subject: [patch added to 3.12-stable] ext4: return -ENOMEM instead of success Date: Fri, 13 Jan 2017 08:41:47 +0100 Message-Id: <20170113074159.26811-21-jslaby@suse.cz> In-Reply-To: <20170113074159.26811-1-jslaby@suse.cz> References: <20170113074159.26811-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Dan Carpenter This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== 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 Signed-off-by: Theodore Ts'o Signed-off-by: Jiri Slaby --- fs/ext4/inline.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index b7e491056f9c..a4d6e9a953f9 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -339,8 +339,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); -- 2.11.0