mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-28 09:14:00 +00:00
USB: oti6858: do not call set_termios with uninitialised data
Make sure set_termios is not called with uninitialised data at open. The old termios struct is currently not used, but pass NULL instead to avoid future problems (e.g. stack data leak). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3ba19fe31b
commit
dc43ff924d
1 changed files with 1 additions and 2 deletions
|
@ -508,7 +508,6 @@ static void oti6858_set_termios(struct tty_struct *tty,
|
||||||
static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port)
|
static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||||
{
|
{
|
||||||
struct oti6858_private *priv = usb_get_serial_port_data(port);
|
struct oti6858_private *priv = usb_get_serial_port_data(port);
|
||||||
struct ktermios tmp_termios;
|
|
||||||
struct usb_serial *serial = port->serial;
|
struct usb_serial *serial = port->serial;
|
||||||
struct oti6858_control_pkt *buf;
|
struct oti6858_control_pkt *buf;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -559,7 +558,7 @@ static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||||
|
|
||||||
/* setup termios */
|
/* setup termios */
|
||||||
if (tty)
|
if (tty)
|
||||||
oti6858_set_termios(tty, port, &tmp_termios);
|
oti6858_set_termios(tty, port, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue