btrfs-progs: Init root_item to avoid gcc 4.8.2 warning

When using gcc 4.8.2, -Wmaybe-uninitialized will report root_item may be
used uninitialized.
Since root_item_valid variant is used to determine the root_item valid,
it's a false alert and to avoid the warning, just init it on allocation.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
Qu Wenruo 2014-02-26 16:23:08 +08:00 committed by Chris Mason
parent 41d6c3c265
commit d98a5ffe6f
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ int subvol_uuid_search_init(int mnt_fd, struct subvol_uuid_search *s)
struct btrfs_ioctl_search_key *sk = &args.key;
struct btrfs_ioctl_search_header *sh;
struct btrfs_root_item *root_item_ptr;
struct btrfs_root_item root_item;
struct btrfs_root_item root_item = {};
struct subvol_info *si = NULL;
int root_item_valid = 0;
unsigned long off = 0;