From: Anand Jain <anand.j...@oracle.com>

Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
 debug-tree.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/debug-tree.c b/debug-tree.c
index 94ffd8e..0e391fc 100644
--- a/debug-tree.c
+++ b/debug-tree.c
@@ -30,7 +30,7 @@
 
 static int print_usage(void)
 {
-       fprintf(stderr, "usage: debug-tree [ -e ] device\n");
+       fprintf(stderr, "usage: debug-tree [-derR] [-b <num>] device\n");
        fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
        exit(1);
 }
@@ -51,6 +51,8 @@ static void print_extents(struct btrfs_root *root, struct 
extent_buffer *eb)
                                             btrfs_node_blockptr(eb, i),
                                             size,
                                             btrfs_node_ptr_generation(eb, i));
+               if(!next)
+                       BUG();
                if (btrfs_is_leaf(next) &&
                    btrfs_header_level(eb) != 1)
                        BUG();
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to