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:
parent
844caf8639
commit
12bdb72d50
|
@ -1742,8 +1742,6 @@ void btrfs_print_tree(struct extent_buffer *eb, unsigned int mode)
|
|||
const bool follow = (mode & BTRFS_PRINT_TREE_FOLLOW);
|
||||
unsigned int traverse = BTRFS_PRINT_TREE_DEFAULT;
|
||||
|
||||
if (!eb)
|
||||
return;
|
||||
/* BFS is default and takes precedence if both are set */
|
||||
if (mode & BTRFS_PRINT_TREE_DFS)
|
||||
traverse = BTRFS_PRINT_TREE_DFS;
|
||||
|
|
Loading…
Reference in New Issue