提交 75d14ede 编写于 作者: J Jason Wessel

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: NJason Wessel <jason.wessel@windriver.com>
上级 e3bda3ac
...@@ -2826,7 +2826,7 @@ int kdb_unregister(char *cmd) ...@@ -2826,7 +2826,7 @@ int kdb_unregister(char *cmd)
/* /*
* find the command. * find the command.
*/ */
for (i = 0, kp = kdb_commands; i < kdb_max_commands; i++, kp++) { for_each_kdbcmd(kp, i) {
if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) { if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) {
kp->cmd_name = NULL; kp->cmd_name = NULL;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册