btrfs-progs: prevent close_root if the root to close is potentially NULL
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>
Thu, 24 Apr 2014 03:39:28 +0000 (11:39 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 2 May 2014 15:05:29 +0000 (17:05 +0200)
commit9317400a67ea9c66fe727b21ddf0e7d925dbdaf1
tree6f3daa3b96825e966bd79b17a9f054186ff3314a
parentaa46922c09159d8315a35b81cacf30dcfb9243a5
btrfs-progs: prevent close_root if the root to close is potentially NULL

Originally only if 'block_only' is specified, the 'fs_root == NULL'
will be checked. But if 'block_only' is not specified and close_root
will be called blindly without checking 'fs_root == NULL', which is
unsafe.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-debug-tree.c