Otherwise we can execced the array bound of path->slots[].
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
orig_ptr = btrfs_node_blockptr(mid, orig_slot);
orig_ptr = btrfs_node_blockptr(mid, orig_slot);
- if (level < BTRFS_MAX_LEVEL - 1)
+ if (level < BTRFS_MAX_LEVEL - 1) {
parent = path->nodes[level + 1];
parent = path->nodes[level + 1];
- pslot = path->slots[level + 1];
+ pslot = path->slots[level + 1];
+ }
/*
* deal with the case where there is only one pointer in the root
/*
* deal with the case where there is only one pointer in the root
mid = path->nodes[level];
WARN_ON(btrfs_header_generation(mid) != trans->transid);
mid = path->nodes[level];
WARN_ON(btrfs_header_generation(mid) != trans->transid);
- if (level < BTRFS_MAX_LEVEL - 1)
+ if (level < BTRFS_MAX_LEVEL - 1) {
parent = path->nodes[level + 1];
parent = path->nodes[level + 1];
- pslot = path->slots[level + 1];
+ pslot = path->slots[level + 1];
+ }