mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-09 19:37:55 +00:00
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>
This commit is contained in:
parent
1bb0bba1b6
commit
a2b24489da
@ -267,7 +267,7 @@ again:
|
|||||||
* Tree's that are not pointed by the tree of tree roots
|
* Tree's that are not pointed by the tree of tree roots
|
||||||
*/
|
*/
|
||||||
if (tree_id && tree_id == BTRFS_ROOT_TREE_OBJECTID) {
|
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");
|
error("cannot print root tree, invalid pointer");
|
||||||
goto no_node;
|
goto no_node;
|
||||||
}
|
}
|
||||||
@ -277,7 +277,7 @@ again:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tree_id && tree_id == BTRFS_CHUNK_TREE_OBJECTID) {
|
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");
|
error("cannot print chunk tree, invalid pointer");
|
||||||
goto no_node;
|
goto no_node;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user