diff options
author | David Sterba <dsterba@suse.cz> | 2011-06-13 15:18:23 +0000 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-06-17 14:54:18 -0400 |
commit | 35a30d7ce54e087d8025a725d4e5a2fdee723a9f (patch) | |
tree | ba7ab5023cde23bb0d7e0ea2e23400db8de80668 /fs | |
parent | 19fd294957e426bfdd8e19085096467ec18df5c4 (diff) | |
download | op-kernel-dev-35a30d7ce54e087d8025a725d4e5a2fdee723a9f.zip op-kernel-dev-35a30d7ce54e087d8025a725d4e5a2fdee723a9f.tar.gz |
btrfs: fix uninitialized return value
When allocation fails in btrfs_read_fs_root_no_name, ret is not set
although it is returned, holding a garbage value.
Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index c25ef5a..1ac8db5d 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1299,12 +1299,12 @@ again: return root; root->free_ino_ctl = kzalloc(sizeof(*root->free_ino_ctl), GFP_NOFS); - if (!root->free_ino_ctl) - goto fail; root->free_ino_pinned = kzalloc(sizeof(*root->free_ino_pinned), GFP_NOFS); - if (!root->free_ino_pinned) + if (!root->free_ino_pinned || !root->free_ino_ctl) { + ret = -ENOMEM; goto fail; + } btrfs_init_free_ino_ctl(root); mutex_init(&root->fs_commit_mutex); |