提交 676e4c86 编写于 作者: D Dan Carpenter 提交者: Chris Mason

Btrfs: handle kzalloc() failure in open_ctree()

Unwind and return -ENOMEM if the allocation fails here.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 fb4f6f91
......@@ -1941,8 +1941,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
btrfs_level_size(tree_root,
btrfs_super_log_root_level(disk_super));
log_tree_root = kzalloc(sizeof(struct btrfs_root),
GFP_NOFS);
log_tree_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
if (!log_tree_root) {
err = -ENOMEM;
goto fail_trans_kthread;
}
__setup_root(nodesize, leafsize, sectorsize, stripesize,
log_tree_root, fs_info, BTRFS_TREE_LOG_OBJECTID);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册