1 ext4: fix some error pointer dereferences
3 From: Dan Carpenter <dan.carpenter@oracle.com>
5 We can't pass error pointers to brelse().
7 Fixes: fb265c9cb49e ("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases")
8 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 Reviewed-by: Jan Kara <jack@suse.cz>
12 fs/ext4/xattr.c | 3 +++
13 1 file changed, 3 insertions(+)
15 diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
16 index 7fddd519adae..6ddbbe21fdd8 100644
19 @@ -829,6 +829,7 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
20 bh = ext4_sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl, REQ_PRIO);
27 @@ -2903,6 +2904,7 @@ int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,
29 EXT4_ERROR_INODE(inode, "block %llu read error",
30 EXT4_I(inode)->i_file_acl);
34 error = ext4_xattr_check_block(inode, bh);
35 @@ -3059,6 +3061,7 @@ ext4_xattr_block_cache_find(struct inode *inode,
37 if (PTR_ERR(bh) == -ENOMEM)
40 EXT4_ERROR_INODE(inode, "block %lu read error",
41 (unsigned long)ce->e_value);
42 } else if (ext4_xattr_cmp(header, BHDR(bh)) == 0) {