Skip to content

Commit

Permalink
Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/…
Browse files Browse the repository at this point in the history
…kgdboc

commit 3ec8002 upstream.

Echo "" to /sys/module/kgdboc/parameters/kgdboc will fail with "No such
device” error.

This is caused by function "configure_kgdboc" who init err to ENODEV
when the config is empty (legal input) the code go out with ENODEV
returned.

Fixes: 2dd4531 ("kgdboc: Fix restrict error")
Signed-off-by: Wentao Wang <witallwang@gmail.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
witallwang authored and gregkh committed Apr 3, 2019
1 parent 1c992ea commit c956914
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/tty/serial/kgdboc.c
Expand Up @@ -145,8 +145,10 @@ static int configure_kgdboc(void)
char *cptr = config;
struct console *cons;

if (!strlen(config) || isspace(config[0]))
if (!strlen(config) || isspace(config[0])) {
err = 0;
goto noconfig;
}

kgdboc_io_ops.is_console = 0;
kgdb_tty_driver = NULL;
Expand Down

0 comments on commit c956914

Please sign in to comment.