Btrfs: use right type to get real comparison

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 <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
Liu Bo 2014-06-08 19:04:13 +08:00 коммит произвёл Chris Mason
Родитель 8a56457f5f
Коммит cd857dd6bc
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1428,7 +1428,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;
}