aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-debug-tree.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-15 14:00:41 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-15 14:16:36 +0100
commita2b24489da60cd516d4bb44bb99f8f39140973da (patch)
tree5f779603111486c7bac49e08ac2fba2ad2f9d967 /btrfs-debug-tree.c
parent1bb0bba1b625eec1bd288699f10c8855034daef1 (diff)
downloadbtrfs-progs-a2b24489da60cd516d4bb44bb99f8f39140973da.tar.gz
btrfs-progs-a2b24489da60cd516d4bb44bb99f8f39140973da.tar.xz
btrfs-progs-a2b24489da60cd516d4bb44bb99f8f39140973da.zip
btrfs-progs: debug-tree: tweak tree node checks
The tree root and chunk root base pointers are verified in open_ctree so we don't get NULL here. We still check the node pointers to get better error message. Resolves-coverity-id: 1348450 Resolves-coverity-id: 1348451 Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-debug-tree.c')
-rw-r--r--btrfs-debug-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
index 05f9a81..266176f 100644
--- a/btrfs-debug-tree.c
+++ b/btrfs-debug-tree.c
@@ -267,7 +267,7 @@ again:
* Tree's that are not pointed by the tree of tree roots
*/
if (tree_id && tree_id == BTRFS_ROOT_TREE_OBJECTID) {
- if (!info->tree_root) {
+ if (!info->tree_root->node) {
error("cannot print root tree, invalid pointer");
goto no_node;
}
@@ -277,7 +277,7 @@ again:
}
if (tree_id && tree_id == BTRFS_CHUNK_TREE_OBJECTID) {
- if (!info->chunk_root) {
+ if (!info->chunk_root->node) {
error("cannot print chunk tree, invalid pointer");
goto no_node;
}