summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index b35b297d4446..cd538ecc1f3f 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1328,8 +1328,10 @@ int bch2_fs_initialize(struct bch_fs *c)
err = "error marking superblock and journal";
for_each_member_device(ca, c, i) {
ret = bch2_trans_mark_dev_sb(c, ca);
- if (ret)
+ if (ret) {
+ percpu_ref_put(&ca->ref);
goto err;
+ }
}
bch2_inode_init(c, &root_inode, 0, 0,