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>
This commit is contained in:
Al Viro 2010-03-20 21:57:43 -04:00
Родитель a135aa2cd7
Коммит 894680710d
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -384,19 +384,16 @@ static int devpts_get_sb(struct file_system_type *fs_type,
s->s_flags |= MS_ACTIVE; s->s_flags |= MS_ACTIVE;
} }
simple_set_mnt(mnt, s);
memcpy(&(DEVPTS_SB(s))->mount_opts, &opts, sizeof(opts)); memcpy(&(DEVPTS_SB(s))->mount_opts, &opts, sizeof(opts));
error = mknod_ptmx(s); error = mknod_ptmx(s);
if (error) if (error)
goto out_dput; goto out_undo_sget;
simple_set_mnt(mnt, s);
return 0; return 0;
out_dput:
dput(s->s_root); /* undo dget() in simple_set_mnt() */
out_undo_sget: out_undo_sget:
deactivate_locked_super(s); deactivate_locked_super(s);
return error; return error;