btrfs-progs: print-tree: fix deref before check in btrfs_print_tree()

Reported by 'gcc -fanalyzer':
kernel-shared/print-tree.c:1745:12: warning: check of ‘eb’ for NULL after already dereferencing it [-Wanalyzer-deref-before-check]

The fs_info is initialized before we check 'eb' but we always get a
valid one so no need to validate it.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2024-04-04 01:06:07 +02:00
parent 844caf8639
commit 12bdb72d50
1 changed files with 0 additions and 2 deletions

View File

@ -1742,8 +1742,6 @@ void btrfs_print_tree(struct extent_buffer *eb, unsigned int mode)
const bool follow = (mode & BTRFS_PRINT_TREE_FOLLOW); const bool follow = (mode & BTRFS_PRINT_TREE_FOLLOW);
unsigned int traverse = BTRFS_PRINT_TREE_DEFAULT; unsigned int traverse = BTRFS_PRINT_TREE_DEFAULT;
if (!eb)
return;
/* BFS is default and takes precedence if both are set */ /* BFS is default and takes precedence if both are set */
if (mode & BTRFS_PRINT_TREE_DFS) if (mode & BTRFS_PRINT_TREE_DFS)
traverse = BTRFS_PRINT_TREE_DFS; traverse = BTRFS_PRINT_TREE_DFS;