apparmor: simplify sysctls with register_sysctl_init()
Using register_sysctl_paths() is really only needed if you have subdirectories with entries. We can use the simple register_sysctl() instead. Acked-by: John Johansen <john.johansen@canonical.com> Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
parent
228b09de93
commit
96200952ab
@ -1764,11 +1764,6 @@ static int apparmor_dointvec(struct ctl_table *table, int write,
|
|||||||
return proc_dointvec(table, write, buffer, lenp, ppos);
|
return proc_dointvec(table, write, buffer, lenp, ppos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ctl_path apparmor_sysctl_path[] = {
|
|
||||||
{ .procname = "kernel", },
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ctl_table apparmor_sysctl_table[] = {
|
static struct ctl_table apparmor_sysctl_table[] = {
|
||||||
{
|
{
|
||||||
.procname = "unprivileged_userns_apparmor_policy",
|
.procname = "unprivileged_userns_apparmor_policy",
|
||||||
@ -1790,8 +1785,7 @@ static struct ctl_table apparmor_sysctl_table[] = {
|
|||||||
|
|
||||||
static int __init apparmor_init_sysctl(void)
|
static int __init apparmor_init_sysctl(void)
|
||||||
{
|
{
|
||||||
return register_sysctl_paths(apparmor_sysctl_path,
|
return register_sysctl("kernel", apparmor_sysctl_table) ? 0 : -ENOMEM;
|
||||||
apparmor_sysctl_table) ? 0 : -ENOMEM;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline int apparmor_init_sysctl(void)
|
static inline int apparmor_init_sysctl(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user