Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc

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: 2dd453168643 ("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>

authored by

Wentao Wang and committed by
Greg Kroah-Hartman
3ec80029 898a737c

+3 -1
+3 -1
drivers/tty/serial/kgdboc.c
··· 148 148 char *cptr = config; 149 149 struct console *cons; 150 150 151 - if (!strlen(config) || isspace(config[0])) 151 + if (!strlen(config) || isspace(config[0])) { 152 + err = 0; 152 153 goto noconfig; 154 + } 153 155 154 156 kgdboc_io_ops.is_console = 0; 155 157 kgdb_tty_driver = NULL;