summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-07-09 11:14:39 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 10:04:16 -0400
commit4d27f3266f14e4d1d13125ce32cb49a40f3122c3 (patch)
treef8563984e4278fc0ddd68c4bdd277f8179014ef5 /fs/open.c
parentf5d11409e61dadf1f9af91b22bbedc28a60a2e2c (diff)
downloadlinux-4d27f3266f14e4d1d13125ce32cb49a40f3122c3.tar.bz2
fold put_filp() into fput()
Just check FMODE_OPENED in __fput() and be done with that... Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/open.c b/fs/open.c
index f3c6cb6a57b9..3d09b823f12b 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -921,15 +921,10 @@ struct file *dentry_open(const struct path *path, int flags,
f = alloc_empty_file(flags, cred);
if (!IS_ERR(f)) {
error = vfs_open(path, f);
- if (!error) {
- /* from now on we need fput() to dispose of f */
+ if (!error)
error = open_check_o_direct(f);
- if (error) {
- fput(f);
- f = ERR_PTR(error);
- }
- } else {
- put_filp(f);
+ if (error) {
+ fput(f);
f = ERR_PTR(error);
}
}