diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-25 07:29:44 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-25 07:29:44 -0700 |
| commit | 194c8581eb9b6d42e9232c7693d86d2ee3799986 (patch) | |
| tree | 86d926b7407c33379dd719fad2ccaf03d5c5228a /fs/debugfs/file.c | |
| parent | c0ff9019ee64101fda8f19338da799fda8217e14 (diff) | |
| parent | 33688abb2802ff3a230bd2441f765477b94cc89e (diff) | |
Merge 4.7-rc4 into char-misc-next
We want those fixes in here to help with merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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); |
