Btrfs: fix error handling in btrfs_get_sb
diff mbox

Message ID 1273772954-2745-1-git-send-email-josef@redhat.com
State New, archived
Headers show

Commit Message

Josef Bacik May 13, 2010, 5:49 p.m. UTC
None

Patch
diff mbox

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 1866dff..6ba4142 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -627,7 +627,7 @@  static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
 	if (IS_ERR(root)) {
 		error = PTR_ERR(root);
 		deactivate_locked_super(s);
-		goto error;
+		goto error_free_subvol_name;
 	}
 	/* if they gave us a subvolume name bind mount into that */
 	if (strcmp(subvol_name, ".")) {
@@ -641,14 +641,14 @@  static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
 			deactivate_locked_super(s);
 			error = PTR_ERR(new_root);
 			dput(root);
-			goto error_close_devices;
+			goto error_free_subvol_name;
 		}
 		if (!new_root->d_inode) {
 			dput(root);
 			dput(new_root);
 			deactivate_locked_super(s);
 			error = -ENXIO;
-			goto error_close_devices;
+			goto error_free_subvol_name;
 		}
 		dput(root);
 		root = new_root;
@@ -666,7 +666,6 @@  error_close_devices:
 	btrfs_close_devices(fs_devices);
 error_free_subvol_name:
 	kfree(subvol_name);
-error:
 	return error;
 }