]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/disable-kgdboc-failed-by-echo-space-to-sys-module-kgdboc-parameters-kgdboc.patch
Linux 4.9.167
[thirdparty/kernel/stable-queue.git] / queue-4.14 / disable-kgdboc-failed-by-echo-space-to-sys-module-kgdboc-parameters-kgdboc.patch
1 From 3ec8002951ea173e24b466df1ea98c56b7920e63 Mon Sep 17 00:00:00 2001
2 From: Wentao Wang <witallwang@gmail.com>
3 Date: Wed, 20 Mar 2019 15:30:39 +0000
4 Subject: Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Wentao Wang <witallwang@gmail.com>
10
11 commit 3ec8002951ea173e24b466df1ea98c56b7920e63 upstream.
12
13 Echo "" to /sys/module/kgdboc/parameters/kgdboc will fail with "No such
14 deviceā€ error.
15
16 This is caused by function "configure_kgdboc" who init err to ENODEV
17 when the config is empty (legal input) the code go out with ENODEV
18 returned.
19
20 Fixes: 2dd453168643 ("kgdboc: Fix restrict error")
21 Signed-off-by: Wentao Wang <witallwang@gmail.com>
22 Cc: stable <stable@vger.kernel.org>
23 Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26 ---
27 drivers/tty/serial/kgdboc.c | 4 +++-
28 1 file changed, 3 insertions(+), 1 deletion(-)
29
30 --- a/drivers/tty/serial/kgdboc.c
31 +++ b/drivers/tty/serial/kgdboc.c
32 @@ -148,8 +148,10 @@ static int configure_kgdboc(void)
33 char *cptr = config;
34 struct console *cons;
35
36 - if (!strlen(config) || isspace(config[0]))
37 + if (!strlen(config) || isspace(config[0])) {
38 + err = 0;
39 goto noconfig;
40 + }
41
42 kgdboc_io_ops.is_console = 0;
43 kgdb_tty_driver = NULL;