]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Fix ref leak in write_super()
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 19 Apr 2025 06:50:29 +0000 (02:50 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 20 Apr 2025 23:41:38 +0000 (19:41 -0400)
found with the new enumerated_ref code

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super-io.c

index 25b6bce05c3cce6993ef86b25cf3276527117a39..cb5d960aed92a6d3d25e745b3a7de0401b34a783 100644 (file)
@@ -1102,7 +1102,8 @@ int bch2_write_super(struct bch_fs *c)
                prt_str(&buf, ")");
                bch2_fs_fatal_error(c, ": %s", buf.buf);
                printbuf_exit(&buf);
-               return -BCH_ERR_sb_not_downgraded;
+               ret = -BCH_ERR_sb_not_downgraded;
+               goto out;
        }
 
        darray_for_each(online_devices, ca) {