mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
bcachefs: Fix a null ptr deref
bch2_btree_iter_peek() won't always return a key - whoops. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
9dd89a05fd
commit
443d2760e5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user