From: Liu Bo Date: Sun, 8 Jun 2014 11:04:13 +0000 (+0800) Subject: Btrfs: use right type to get real comparison X-Git-Tag: submit/tizen_common/20140730.172411~331 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f850fdfbb90c57178e24e9e6c9fc32d18cc23e1;p=profile%2Fivi%2Fkernel-x86-ivi.git Btrfs: use right type to get real comparison commit cd857dd6bc2ae9ecea14e75a34e8a8fdc158e307 upstream. We want to make sure the point is still within the extent item, not to verify the memory it's pointing to. Signed-off-by: Liu Bo Signed-off-by: Chris Mason Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 36cca1d..94eede4 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -1431,7 +1431,7 @@ static int __get_extent_inline_ref(unsigned long *ptr, struct extent_buffer *eb, *out_eiref = (struct btrfs_extent_inline_ref *)(ei + 1); } *ptr = (unsigned long)*out_eiref; - if ((void *)*ptr >= (void *)ei + item_size) + if ((unsigned long)(*ptr) >= (unsigned long)ei + item_size) return -ENOENT; }