Commit 443d2760 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a null ptr deref

bch2_btree_iter_peek() won't always return a key - whoops.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 9dd89a05
......@@ -522,6 +522,11 @@ static int lookup_inode(struct btree_trans *trans, struct bpos pos,
if (ret)
goto err;
if (!k.k || bkey_cmp(k.k->p, pos)) {
ret = -ENOENT;
goto err;
}
ret = k.k->type == KEY_TYPE_inode ? 0 : -EIO;
if (ret)
goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment