Re: [PATCH 1/2] usb: gadget: serial: zero-initialize struct variable gscons_info

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

 



Hi,

Felix Hädicke <felixhaedicke@xxxxxx> 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 <felixhaedicke@xxxxxx>
> ---
>  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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux