Hi,

Felix Hädicke <felixhaedi...@web.de> writes:
> There can be cases when members of the gscons_info struct are used
> uninitialized, e. g. in, gserial_console_exit(), if gs_console_setup()
> was not called before.
>
> Signed-off-by: Felix Hädicke <felixhaedi...@web.de>
> ---
>  drivers/usb/gadget/function/u_serial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/u_serial.c 
> b/drivers/usb/gadget/function/u_serial.c
> index e0cd1e4..5fedead 100644
> --- a/drivers/usb/gadget/function/u_serial.c
> +++ b/drivers/usb/gadget/function/u_serial.c
> @@ -1043,7 +1043,7 @@ static struct tty_driver *gs_tty_driver;
>  
>  #ifdef CONFIG_U_SERIAL_CONSOLE
>  
> -static struct gscons_info gscons_info;
> +static struct gscons_info gscons_info = {};

this can't be needed. static variables are zero-initialized
"automatically".

-- 
balbi

Attachment: signature.asc
Description: PGP signature

Reply via email to