Skip to content

Commit e92c294

Browse files
Dan Carpenterkdave
authored andcommitted
btrfs: tree-checker: fix bounds check in check_inode_extref()
The parentheses for the unlikely() annotation were put in the wrong place so it means that the condition is basically never true and the bounds checking is skipped. Fixes: aab9458 ("btrfs: tree-checker: add inode extref checks") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent fec9b9d commit e92c294

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/tree-checker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ static int check_inode_extref(struct extent_buffer *leaf,
17971797
struct btrfs_inode_extref *extref = (struct btrfs_inode_extref *)ptr;
17981798
u16 namelen;
17991799

1800-
if (unlikely(ptr + sizeof(*extref)) > end) {
1800+
if (unlikely(ptr + sizeof(*extref) > end)) {
18011801
inode_ref_err(leaf, slot,
18021802
"inode extref overflow, ptr %lu end %lu inode_extref size %zu",
18031803
ptr, end, sizeof(*extref));

0 commit comments

Comments
 (0)