diff options
Diffstat (limited to 'fs/proc/proc_sysctl.c')
-rw-r--r-- | fs/proc/proc_sysctl.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index dfafeb2b05a0..eb7cc91b7258 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -462,9 +462,6 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, | |||
462 | 462 | ||
463 | err = ERR_PTR(-ENOMEM); | 463 | err = ERR_PTR(-ENOMEM); |
464 | inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); | 464 | inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); |
465 | if (h) | ||
466 | sysctl_head_finish(h); | ||
467 | |||
468 | if (!inode) | 465 | if (!inode) |
469 | goto out; | 466 | goto out; |
470 | 467 | ||
@@ -473,6 +470,8 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, | |||
473 | d_add(dentry, inode); | 470 | d_add(dentry, inode); |
474 | 471 | ||
475 | out: | 472 | out: |
473 | if (h) | ||
474 | sysctl_head_finish(h); | ||
476 | sysctl_head_finish(head); | 475 | sysctl_head_finish(head); |
477 | return err; | 476 | return err; |
478 | } | 477 | } |