aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-02-21 11:17:34 -0500
committerTheodore Ts'o <tytso@mit.edu>2019-02-21 11:17:34 -0500
commit7159a986b4202343f6cca3bb8079ecace5816fd6 (patch)
tree826bd55a9430873c0d6acec4b513f9e62f9cd5dd
parent793bc5181b14bf7cdfefe9d2fe8fc4a8114b78f9 (diff)
ext4: fix some error pointer dereferences
We can't pass error pointers to brelse(). Fixes: fb265c9cb49e ("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/ext4/xattr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 86ed9c686249..dc82e7757f67 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -829,6 +829,7 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
829 bh = ext4_sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl, REQ_PRIO); 829 bh = ext4_sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl, REQ_PRIO);
830 if (IS_ERR(bh)) { 830 if (IS_ERR(bh)) {
831 ret = PTR_ERR(bh); 831 ret = PTR_ERR(bh);
832 bh = NULL;
832 goto out; 833 goto out;
833 } 834 }
834 835
@@ -2903,6 +2904,7 @@ int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,
2903 if (error == -EIO) 2904 if (error == -EIO)
2904 EXT4_ERROR_INODE(inode, "block %llu read error", 2905 EXT4_ERROR_INODE(inode, "block %llu read error",
2905 EXT4_I(inode)->i_file_acl); 2906 EXT4_I(inode)->i_file_acl);
2907 bh = NULL;
2906 goto cleanup; 2908 goto cleanup;
2907 } 2909 }
2908 error = ext4_xattr_check_block(inode, bh); 2910 error = ext4_xattr_check_block(inode, bh);
@@ -3059,6 +3061,7 @@ ext4_xattr_block_cache_find(struct inode *inode,
3059 if (IS_ERR(bh)) { 3061 if (IS_ERR(bh)) {
3060 if (PTR_ERR(bh) == -ENOMEM) 3062 if (PTR_ERR(bh) == -ENOMEM)
3061 return NULL; 3063 return NULL;
3064 bh = NULL;
3062 EXT4_ERROR_INODE(inode, "block %lu read error", 3065 EXT4_ERROR_INODE(inode, "block %lu read error",
3063 (unsigned long)ce->e_value); 3066 (unsigned long)ce->e_value);
3064 } else if (ext4_xattr_cmp(header, BHDR(bh)) == 0) { 3067 } else if (ext4_xattr_cmp(header, BHDR(bh)) == 0) {