]> git.hungrycats.org Git - linux/commitdiff
btrfs: fix error labels in init_btrfs_fs
authorDavid Sterba <dsterba@suse.cz>
Tue, 29 Jul 2014 22:58:37 +0000 (00:58 +0200)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 23 Jan 2015 13:14:49 +0000 (08:14 -0500)
btrfs_interface_init rarely fails but we could leak the prelim_ref slab.

Signed-off-by: David Sterba <dsterba@suse.cz>
(cherry picked from commit af13b4922b057b4ebc7e2315a6f666ecb65890e4)

fs/btrfs/super.c

index 6ece313439362fbaad5cc5e1619b0e7b4f395a3d..42aaa73f3f90723ac3e42a21c19939e4096fd171 100644 (file)
@@ -1999,11 +1999,11 @@ static int __init init_btrfs_fs(void)
 
        err = btrfs_prelim_ref_init();
        if (err)
-               goto free_prelim_ref;
+               goto free_delayed_ref;
 
        err = btrfs_end_io_wq_init();
        if (err)
-               goto free_delayed_ref;
+               goto free_prelim_ref;
 
        err = btrfs_interface_init();
        if (err)