Commit 9e48f574 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix leak in bch2_fs_recovery() error path



Fix a small leak of the superblock 'clean' section.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 54aacfe3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1108,9 +1108,6 @@ int bch2_fs_recovery(struct bch_fs *c)
out:
	bch2_flush_fsck_errs(c);

	if (!IS_ERR(clean))
		kfree(clean);

	if (!ret &&
	    test_bit(BCH_FS_need_delete_dead_snapshots, &c->flags) &&
	    !c->opts.nochanges) {
@@ -1119,6 +1116,9 @@ int bch2_fs_recovery(struct bch_fs *c)
	}

	bch_err_fn(c, ret);
final_out:
	if (!IS_ERR(clean))
		kfree(clean);
	return ret;
err:
fsck_err:
@@ -1132,7 +1132,7 @@ int bch2_fs_recovery(struct bch_fs *c)
		bch2_print_str(c, KERN_ERR, buf.buf);
		printbuf_exit(&buf);
	}
	return ret;
	goto final_out;
}

int bch2_fs_initialize(struct bch_fs *c)