Re: [PATCH] Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 20, 2019 at 03:30:39PM +0000, 王 文涛 wrote:
> From: Wentao Wang <witallwang@xxxxxxxxx>
> 
> 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: 2dd453168643d ("kgdboc: Fix restrict error")
> 
> Signed-off-by: Wentao Wang <witallwang@xxxxxxxxx>

Acked-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>


Thanks!

Daniel.

> ---
>  drivers/tty/serial/kgdboc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
> index 6fb312e..bfe5e9e 100644
> --- a/drivers/tty/serial/kgdboc.c
> +++ b/drivers/tty/serial/kgdboc.c
> @@ -148,8 +148,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;
> -- 
> 2.7.4
> 



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux