Skip to content

Commit 9e48f57

Browse files
author
Kent Overstreet
committed
bcachefs: Fix leak in bch2_fs_recovery() error path
Fix a small leak of the superblock 'clean' section. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 54aacfe commit 9e48f57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/bcachefs/recovery.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,9 +1108,6 @@ int bch2_fs_recovery(struct bch_fs *c)
11081108
out:
11091109
bch2_flush_fsck_errs(c);
11101110

1111-
if (!IS_ERR(clean))
1112-
kfree(clean);
1113-
11141111
if (!ret &&
11151112
test_bit(BCH_FS_need_delete_dead_snapshots, &c->flags) &&
11161113
!c->opts.nochanges) {
@@ -1119,6 +1116,9 @@ int bch2_fs_recovery(struct bch_fs *c)
11191116
}
11201117

11211118
bch_err_fn(c, ret);
1119+
final_out:
1120+
if (!IS_ERR(clean))
1121+
kfree(clean);
11221122
return ret;
11231123
err:
11241124
fsck_err:
@@ -1132,7 +1132,7 @@ int bch2_fs_recovery(struct bch_fs *c)
11321132
bch2_print_str(c, KERN_ERR, buf.buf);
11331133
printbuf_exit(&buf);
11341134
}
1135-
return ret;
1135+
goto final_out;
11361136
}
11371137

11381138
int bch2_fs_initialize(struct bch_fs *c)

0 commit comments

Comments
 (0)