Commit 6cf8bfbf authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Mason
Browse files

Btrfs: check btrfs_get_extent return for IS_ERR()



btrfs_get_extent() never returns NULL, only a valid pointer or ERR_PTR()
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent c2b96929
...@@ -510,7 +510,7 @@ static int should_defrag_range(struct inode *inode, u64 start, u64 len, ...@@ -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); em = btrfs_get_extent(inode, NULL, 0, start, len, 0);
unlock_extent(io_tree, start, start + len - 1, GFP_NOFS); unlock_extent(io_tree, start, start + len - 1, GFP_NOFS);
if (!em) if (IS_ERR(em))
return 0; return 0;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment