From: Dan Carpenter Date: Sat, 20 Mar 2010 11:22:10 +0000 (+0000) Subject: Btrfs: check btrfs_get_extent return for IS_ERR() X-Git-Tag: MMI-PSA29.97-13-9~23937^2~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6cf8bfbf5e88edfb09a2bf0631a067060f534592;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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: Dan Carpenter Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 74d89133f768..2b7dd88fc54f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -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; }