Skip to content

Commit

Permalink
Btrfs: fix error handling in delete_block_group_cache()
Browse files Browse the repository at this point in the history
btrfs_iget() never return NULL.
So, NULL check is unnecessary.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
  • Loading branch information
Tsutomu Itoh authored and Chris Mason committed Oct 1, 2012
1 parent 903889f commit f54fb85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/relocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -3270,8 +3270,8 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
key.offset = 0;

inode = btrfs_iget(fs_info->sb, &key, root, NULL);
if (IS_ERR_OR_NULL(inode) || is_bad_inode(inode)) {
if (inode && !IS_ERR(inode))
if (IS_ERR(inode) || is_bad_inode(inode)) {
if (!IS_ERR(inode))
iput(inode);
return -ENOENT;
}
Expand Down

0 comments on commit f54fb85

Please sign in to comment.