diff options
author | Thomas Bertschinger <tahbertschinger@gmail.com> | 2023-12-14 22:06:41 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-14 23:24:14 +0300 |
commit | 50a8a732d2db64507ba7cd4ebe66538d9c40bea8 (patch) | |
tree | efdd19718279609af9d81664a3832092ed3f48f7 /fs/bcachefs/super.c | |
parent | 8bf771972b8468b6a841d088141ac2960e6927fd (diff) | |
download | linux-50a8a732d2db64507ba7cd4ebe66538d9c40bea8.tar.xz |
bcachefs: fix invalid memory access in bch2_fs_alloc() error path
When bch2_fs_alloc() gets an error before calling
bch2_fs_btree_iter_init(), bch2_fs_btree_iter_exit() makes an invalid
memory access because btree_trans_list is uninitialized.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Fixes: 6bd68ec266ad ("bcachefs: Heap allocate btree_trans")
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r-- | fs/bcachefs/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index f63474c5c5a2..cfa91188dd4e 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -714,6 +714,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) bch2_fs_copygc_init(c); bch2_fs_btree_key_cache_init_early(&c->btree_key_cache); + bch2_fs_btree_iter_init_early(c); bch2_fs_btree_interior_update_init_early(c); bch2_fs_allocator_background_init(c); bch2_fs_allocator_foreground_init(c); |