aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-10-11 11:20:14 -0400
committerJason Wessel <jason.wessel@windriver.com>2010-10-22 16:34:12 -0400
commit75d14edee5689716b55afe467acfc13206a31f95 (patch)
tree2646d65a43916e2eac7e24e8b23f1f82918b6702
parente3bda3ac33d3bf3e5a4049e2cabe82d3caaffc26 (diff)
kdb: Fix oops in kdb_unregister
Nothing should try to use kdb_commands directly as sometimes it is null. Instead, use the for_each_kdbcmd() iterator. This particular problem dates back to the initial kdb merge (2.6.35), but at that point nothing was dynamically unregistering commands from the kdb shell. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
-rw-r--r--kernel/debug/kdb/kdb_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 5448990a299e..4226f32517d1 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2826,7 +2826,7 @@ int kdb_unregister(char *cmd)
2826 /* 2826 /*
2827 * find the command. 2827 * find the command.
2828 */ 2828 */
2829 for (i = 0, kp = kdb_commands; i < kdb_max_commands; i++, kp++) { 2829 for_each_kdbcmd(kp, i) {
2830 if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) { 2830 if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) {
2831 kp->cmd_name = NULL; 2831 kp->cmd_name = NULL;
2832 return 0; 2832 return 0;