diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-07-20 09:46:42 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-07-20 09:46:42 +0200 |
commit | 4fffe71dd913cca5532da594e2f48a0db6b494dc (patch) | |
tree | 6e0dc83582382506e8b70760d8b59a50d93bfa5a /fs/debugfs/file.c | |
parent | 4b3b234f434d440fcd749b9636131b76e2ce561e (diff) | |
parent | 47ef4ad2684d380dd6d596140fb79395115c3950 (diff) | |
download | linux-4fffe71dd913cca5532da594e2f48a0db6b494dc.tar.gz linux-4fffe71dd913cca5532da594e2f48a0db6b494dc.tar.xz |
Merge branch 'linus' into x86/cpu, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/debugfs/file.c')
-rw-r--r-- | fs/debugfs/file.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 9c1c9a01b7e5..592059f88e04 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -127,7 +127,6 @@ static int open_proxy_open(struct inode *inode, struct file *filp) r = real_fops->open(inode, filp); out: - fops_put(real_fops); debugfs_use_file_finish(srcu_idx); return r; } @@ -262,8 +261,10 @@ static int full_proxy_open(struct inode *inode, struct file *filp) if (real_fops->open) { r = real_fops->open(inode, filp); - - if (filp->f_op != proxy_fops) { + if (r) { + replace_fops(filp, d_inode(dentry)->i_fop); + goto free_proxy; + } else if (filp->f_op != proxy_fops) { /* No protection against file removal anymore. */ WARN(1, "debugfs file owner replaced proxy fops: %pd", dentry); |