Simplify devpts_get_sb() failure exits
postpone simple_set_mnt() until we know we won't fail.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 0120247..8b3ffd5 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -384,19 +384,16 @@
s->s_flags |= MS_ACTIVE;
}
- simple_set_mnt(mnt, s);
-
memcpy(&(DEVPTS_SB(s))->mount_opts, &opts, sizeof(opts));
error = mknod_ptmx(s);
if (error)
- goto out_dput;
+ goto out_undo_sget;
+
+ simple_set_mnt(mnt, s);
return 0;
-out_dput:
- dput(s->s_root); /* undo dget() in simple_set_mnt() */
-
out_undo_sget:
deactivate_locked_super(s);
return error;