Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 506194da authored by Sriharsha Allenki's avatar Sriharsha Allenki
Browse files

usb: serial: cp210x: Fix usage of uninitialized variable



In the function cp210x_get_termios_port, the variable
bits can be used unitialized if the cp210x_get_line_ctl
function call fails.
Fix this by initializing the variable to zero.

Change-Id: Ie520ecd818b782355412304a9bee403448b68c7a
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent 63098a4e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -745,7 +745,7 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
	unsigned int cflag;
	struct cp210x_flow_ctl flow_ctl;
	u32 baud;
	u16 bits;
	u16 bits = 0;
	u32 ctl_hs;

	cp210x_read_u32_reg(port, CP210X_GET_BAUDRATE, &baud);