Skip to content

Commit

Permalink
sysctl: An easier to read version of find_subdir
Browse files Browse the repository at this point in the history
Suggested-by:  Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Feb 2, 2012
1 parent 1347440 commit 51f72f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,9 @@ static struct ctl_dir *find_subdir(struct ctl_dir *dir,
entry = find_entry(&head, dir, name, namelen);
if (!entry)
return ERR_PTR(-ENOENT);
if (S_ISDIR(entry->mode))
return container_of(head, struct ctl_dir, header);
return ERR_PTR(-ENOTDIR);
if (!S_ISDIR(entry->mode))
return ERR_PTR(-ENOTDIR);
return container_of(head, struct ctl_dir, header);
}

static struct ctl_dir *new_dir(struct ctl_table_set *set,
Expand Down

0 comments on commit 51f72f4

Please sign in to comment.