diff options
-rw-r--r-- | fs/debugfs/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 9c1c9a01b7e5..d1ec80331414 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
@@ -262,8 +262,10 @@ static int full_proxy_open(struct inode *inode, struct file *filp) | |||
262 | 262 | ||
263 | if (real_fops->open) { | 263 | if (real_fops->open) { |
264 | r = real_fops->open(inode, filp); | 264 | r = real_fops->open(inode, filp); |
265 | 265 | if (r) { | |
266 | if (filp->f_op != proxy_fops) { | 266 | replace_fops(filp, d_inode(dentry)->i_fop); |
267 | goto free_proxy; | ||
268 | } else if (filp->f_op != proxy_fops) { | ||
267 | /* No protection against file removal anymore. */ | 269 | /* No protection against file removal anymore. */ |
268 | WARN(1, "debugfs file owner replaced proxy fops: %pd", | 270 | WARN(1, "debugfs file owner replaced proxy fops: %pd", |
269 | dentry); | 271 | dentry); |