]> git.hungrycats.org Git - linux/commitdiff
Btrfs: use right type to get real comparison
authorLiu Bo <bo.li.liu@oracle.com>
Sun, 8 Jun 2014 11:04:13 +0000 (19:04 +0800)
committerJiri Slaby <jslaby@suse.cz>
Wed, 2 Jul 2014 10:06:40 +0000 (12:06 +0200)
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 <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/btrfs/backref.c

index 5eb50b5df7772c040e4fb3f3447e75c088ee2463..79559682255a0ae023700041a5003b8a7b88409c 100644 (file)
@@ -1409,7 +1409,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;
        }