Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cc3e046 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

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: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 8d6ecfcc
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -267,10 +267,10 @@ static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name)


static struct ctl_table_header *grab_header(struct inode *inode)
static struct ctl_table_header *grab_header(struct inode *inode)
{
{
	if (PROC_I(inode)->sysctl)
	struct ctl_table_header *head = PROC_I(inode)->sysctl;
		return sysctl_head_grab(PROC_I(inode)->sysctl);
	if (!head)
	else
		head = &root_table_header;
		return sysctl_head_next(NULL);
	return sysctl_head_grab(head);
}
}


static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,