mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
fold put_filp() into fput()
Just check FMODE_OPENED in __fput() and be done with that... Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
f5d11409e6
commit
4d27f3266f
4 changed files with 10 additions and 21 deletions
11
fs/open.c
11
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue