[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200707200337.l6K3bjDr053658@www262.sakura.ne.jp>
Date: Fri, 20 Jul 2007 12:37:45 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: linux-kernel@...r.kernel.org
Subject: [PATCH] parse_table() earlier check.
/* The part parse_table() does */
for ( ; table->ctl_name || table->procname; table++) {
if (!table->ctl_name)
continue;
if (n == table->ctl_name) {
return do_sysctl_strategy();
}
}
return -ENOTDIR;
/* is equivalent to */
for ( ; table->ctl_name || table->procname; table++) {
if (n == table->ctl_name && n) {
return do_sysctl_strategy();
}
}
return -ENOTDIR;
/* is equivalent to */
if (n) {
for ( ; table->ctl_name || table->procname; table++) {
if (n == table->ctl_name) {
return do_sysctl_strategy();
}
}
}
return -ENOTDIR;
/* and here is a patch. I think this change is harmless. */
-----
Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
sysctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -ur linux-2.6.22-orig/kernel/sysctl.c linux-2.6.22/kernel/sysctl.c
--- linux-2.6.22-orig/kernel/sysctl.c 2007-07-09 08:32:17.000000000 +0900
+++ linux-2.6.22/kernel/sysctl.c 2007-07-20 12:23:17.000000000 +0900
@@ -1190,9 +1190,9 @@
return -ENOTDIR;
if (get_user(n, name))
return -EFAULT;
+ if (!n)
+ return -ENOTDIR;
for ( ; table->ctl_name || table->procname; table++) {
- if (!table->ctl_name)
- continue;
if (n == table->ctl_name) {
int error;
if (table->child) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists