btrfs: fix error labels in init_btrfs_fs
authorDavid Sterba <dsterba@suse.cz>
Tue, 29 Jul 2014 22:58:37 +0000 (00:58 +0200)
committerDavid Sterba <dsterba@suse.cz>
Thu, 2 Oct 2014 15:30:29 +0000 (17:30 +0200)
btrfs_interface_init rarely fails but we could leak the prelim_ref slab.

Signed-off-by: David Sterba <dsterba@suse.cz>
fs/btrfs/super.c

index b1d2a42..b915d77 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_interface_init();
        if (err)
-               goto free_delayed_ref;
+               goto free_prelim_ref;
 
        btrfs_init_lockdep();