Commit 894680710d813137077ad7cb351b713f64cabbdf
1 parent
a135aa2cd7
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 3 additions and 6 deletions Side-by-side Diff
fs/devpts/inode.c
... | ... | @@ -384,18 +384,15 @@ |
384 | 384 | s->s_flags |= MS_ACTIVE; |
385 | 385 | } |
386 | 386 | |
387 | - simple_set_mnt(mnt, s); | |
388 | - | |
389 | 387 | memcpy(&(DEVPTS_SB(s))->mount_opts, &opts, sizeof(opts)); |
390 | 388 | |
391 | 389 | error = mknod_ptmx(s); |
392 | 390 | if (error) |
393 | - goto out_dput; | |
391 | + goto out_undo_sget; | |
394 | 392 | |
395 | - return 0; | |
393 | + simple_set_mnt(mnt, s); | |
396 | 394 | |
397 | -out_dput: | |
398 | - dput(s->s_root); /* undo dget() in simple_set_mnt() */ | |
395 | + return 0; | |
399 | 396 | |
400 | 397 | out_undo_sget: |
401 | 398 | deactivate_locked_super(s); |