Skip to content

Commit

Permalink
sysctl_check: drop table->procname checks
Browse files Browse the repository at this point in the history
Since the for loop checks for the table->procname drop useless
table->procname checks inside the loop body

Signed-off-by: Denis Kirjanov <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Denis Kirjanov authored and torvalds committed Mar 24, 2011
1 parent ad4ac17 commit 814ecf6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/sysctl_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
const char *fail = NULL;

if (table->parent) {
if (table->procname && !table->parent->procname)
if (!table->parent->procname)
set_fail(&fail, table, "Parent without procname");
}
if (!table->procname)
set_fail(&fail, table, "No procname");
if (table->child) {
if (table->data)
set_fail(&fail, table, "Directory with data?");
Expand Down Expand Up @@ -144,7 +142,7 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
set_fail(&fail, table, "No maxlen");
}
#ifdef CONFIG_PROC_SYSCTL
if (table->procname && !table->proc_handler)
if (!table->proc_handler)
set_fail(&fail, table, "No proc_handler");
#endif
#if 0
Expand Down

0 comments on commit 814ecf6

Please sign in to comment.