Commit 64b84ef0 authored by Liu Bo's avatar Liu Bo Committed by Greg Kroah-Hartman

Btrfs: use right type to get real comparison

commit cd857dd6 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: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f1dd63b
......@@ -1033,7 +1033,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;
}
......
Markdown is supported
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