diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-01-07 09:57:47 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-01-24 19:40:28 -0500 |
commit | 3cc3e04636d603778d921854b84ae7bd34a349a2 (patch) | |
tree | a71b0271933f3ed5d30ec7b15fc07e55af80ace6 /fs/proc/proc_sysctl.c | |
parent | 8d6ecfcc014332fd2fe933f64194160f0e3a6696 (diff) |
sysctl: A more obvious version of grab_header.
Instead of relying on sysct_head_next(NULL) to magically
return the right header for the root directory instead
explicitly transform NULL into the root directories header.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/proc/proc_sysctl.c')
-rw-r--r-- | fs/proc/proc_sysctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index e573f9b4f22e..15444850b3e8 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -267,10 +267,10 @@ static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name) | |||
267 | 267 | ||
268 | static struct ctl_table_header *grab_header(struct inode *inode) | 268 | static struct ctl_table_header *grab_header(struct inode *inode) |
269 | { | 269 | { |
270 | if (PROC_I(inode)->sysctl) | 270 | struct ctl_table_header *head = PROC_I(inode)->sysctl; |
271 | return sysctl_head_grab(PROC_I(inode)->sysctl); | 271 | if (!head) |
272 | else | 272 | head = &root_table_header; |
273 | return sysctl_head_next(NULL); | 273 | return sysctl_head_grab(head); |
274 | } | 274 | } |
275 | 275 | ||
276 | static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, | 276 | static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, |