diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index c7150af631b5..62e53a0de4a3 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -1461,7 +1461,9 @@ static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) | |||
1461 | 1461 | ||
1462 | static __init int sysctl_init(void) | 1462 | static __init int sysctl_init(void) |
1463 | { | 1463 | { |
1464 | int err; | ||
1464 | sysctl_set_parent(NULL, root_table); | 1465 | sysctl_set_parent(NULL, root_table); |
1466 | err = sysctl_check_table(root_table); | ||
1465 | return 0; | 1467 | return 0; |
1466 | } | 1468 | } |
1467 | 1469 | ||
@@ -1546,6 +1548,10 @@ struct ctl_table_header *register_sysctl_table(struct ctl_table * table) | |||
1546 | tmp->used = 0; | 1548 | tmp->used = 0; |
1547 | tmp->unregistering = NULL; | 1549 | tmp->unregistering = NULL; |
1548 | sysctl_set_parent(NULL, table); | 1550 | sysctl_set_parent(NULL, table); |
1551 | if (sysctl_check_table(tmp->ctl_table)) { | ||
1552 | kfree(tmp); | ||
1553 | return NULL; | ||
1554 | } | ||
1549 | spin_lock(&sysctl_lock); | 1555 | spin_lock(&sysctl_lock); |
1550 | list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); | 1556 | list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); |
1551 | spin_unlock(&sysctl_lock); | 1557 | spin_unlock(&sysctl_lock); |