diff options
-rw-r--r-- | fs/proc/proc_sysctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index ebe8b3076db7..722ec116208d 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -869,6 +869,7 @@ static struct ctl_dir *get_subdir(struct ctl_dir *dir, | |||
869 | { | 869 | { |
870 | struct ctl_table_set *set = dir->header.set; | 870 | struct ctl_table_set *set = dir->header.set; |
871 | struct ctl_dir *subdir, *new = NULL; | 871 | struct ctl_dir *subdir, *new = NULL; |
872 | int err; | ||
872 | 873 | ||
873 | spin_lock(&sysctl_lock); | 874 | spin_lock(&sysctl_lock); |
874 | subdir = find_subdir(dir, name, namelen); | 875 | subdir = find_subdir(dir, name, namelen); |
@@ -890,7 +891,9 @@ static struct ctl_dir *get_subdir(struct ctl_dir *dir, | |||
890 | if (PTR_ERR(subdir) != -ENOENT) | 891 | if (PTR_ERR(subdir) != -ENOENT) |
891 | goto failed; | 892 | goto failed; |
892 | 893 | ||
893 | if (insert_header(dir, &new->header)) | 894 | err = insert_header(dir, &new->header); |
895 | subdir = ERR_PTR(err); | ||
896 | if (err) | ||
894 | goto failed; | 897 | goto failed; |
895 | subdir = new; | 898 | subdir = new; |
896 | found: | 899 | found: |