1 From 7159a986b4202343f6cca3bb8079ecace5816fd6 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Thu, 21 Feb 2019 11:17:34 -0500
4 Subject: ext4: fix some error pointer dereferences
6 From: Dan Carpenter <dan.carpenter@oracle.com>
8 commit 7159a986b4202343f6cca3bb8079ecace5816fd6 upstream.
10 We can't pass error pointers to brelse().
12 Fixes: fb265c9cb49e ("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases")
13 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
14 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 Reviewed-by: Jan Kara <jack@suse.cz>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 fs/ext4/xattr.c | 3 +++
20 1 file changed, 3 insertions(+)
24 @@ -829,6 +829,7 @@ int ext4_get_inode_usage(struct inode *i
25 bh = ext4_sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl, REQ_PRIO);
32 @@ -2903,6 +2904,7 @@ int ext4_xattr_delete_inode(handle_t *ha
34 EXT4_ERROR_INODE(inode, "block %llu read error",
35 EXT4_I(inode)->i_file_acl);
39 error = ext4_xattr_check_block(inode, bh);
40 @@ -3059,6 +3061,7 @@ ext4_xattr_block_cache_find(struct inode
42 if (PTR_ERR(bh) == -ENOMEM)
45 EXT4_ERROR_INODE(inode, "block %lu read error",
46 (unsigned long)ce->e_value);
47 } else if (ext4_xattr_cmp(header, BHDR(bh)) == 0) {