diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index ba2b2da360d32b15d9a7b924ec84f4b9764ae23d..234e9d08db764e6fa4f5d9249a59bbc41797b94d 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -710,19 +710,16 @@ cifs_do_mount(struct file_system_type *fs_type,
 
 	sb->s_flags |= MS_ACTIVE;
 
+out_shared:
 	root = cifs_get_root(volume_info, sb);
-	if (root == NULL)
+	if (root == NULL) {
+		root = ERR_PTR(-EINVAL); /* XXX */
 		goto out_super;
+	}
 
 	cFYI(1, "dentry root is: %p", root);
 	goto out;
 
-out_shared:
-	root = cifs_get_root(volume_info, sb);
-	if (root)
-		cFYI(1, "dentry root is: %p", root);
-	goto out;
-
 out_super:
 	deactivate_locked_super(sb);
 out: