Skip to content

Commit

Permalink
Btrfs: check btrfs_get_extent return for IS_ERR()
Browse files Browse the repository at this point in the history
btrfs_get_extent() never returns NULL, only a valid pointer or ERR_PTR()

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Dan Carpenter authored and Chris Mason committed Mar 31, 2010
1 parent c2b9692 commit 6cf8bfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ static int should_defrag_range(struct inode *inode, u64 start, u64 len,
em = btrfs_get_extent(inode, NULL, 0, start, len, 0);
unlock_extent(io_tree, start, start + len - 1, GFP_NOFS);

if (!em)
if (IS_ERR(em))
return 0;
}

Expand Down

0 comments on commit 6cf8bfb

Please sign in to comment.