[PATCH] Btrfs: ref-verify: Fix NULL vs IS_ERR() check in walk_down_tree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



read_tree_block() returns error pointers, and never NULL and so I have
updated the error handling.

Fixes: 74739121b4c7 ("Btrfs: add a extent ref verify tool")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index f65d78cf3c7e..34878699d363 100644
--- a/fs/btrfs/ref-verify.c
+++ b/fs/btrfs/ref-verify.c
@@ -584,7 +584,9 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 			gen = btrfs_node_ptr_generation(path->nodes[level],
 							path->slots[level]);
 			eb = read_tree_block(fs_info, block_bytenr, gen);
-			if (!eb || !extent_buffer_uptodate(eb)) {
+			if (IS_ERR(eb))
+				return PTR_ERR(eb);
+			if (!extent_buffer_uptodate(eb)) {
 				free_extent_buffer(eb);
 				return -EIO;
 			}
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux