Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab59381e authored by Zhao Lei's avatar Zhao Lei Committed by Chris Mason
Browse files

Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()



We need to check return value of btrfs_search_slot() in
btrfs_read_chunk_tree() and do corresponding error handing.

Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 471fa17d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3389,6 +3389,8 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
	key.type = 0;
again:
	ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
	if (ret < 0)
		goto error;
	while (1) {
		leaf = path->nodes[0];
		slot = path->slots[0];