Commit 5ced1dd4 authored by Philipp Hachtmann's avatar Philipp Hachtmann Committed by Luis Henriques

USB: symbolserial: Use usb_get_serial_port_data

commit 951d3793 upstream.

The driver used usb_get_serial_data(port->serial) which compiled but resulted
in a NULL pointer being returned (and subsequently used). I did not go deeper
into this but I guess this is a regression.
Signed-off-by: default avatarPhilipp Hachtmann <hachti@hachti.de>
Fixes: a85796ee ("USB: symbolserial: move private-data allocation to
port_probe")
Acked-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 416b9ba1
...@@ -94,7 +94,7 @@ static void symbol_int_callback(struct urb *urb) ...@@ -94,7 +94,7 @@ static void symbol_int_callback(struct urb *urb)
static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port) static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port)
{ {
struct symbol_private *priv = usb_get_serial_data(port->serial); struct symbol_private *priv = usb_get_serial_port_data(port);
unsigned long flags; unsigned long flags;
int result = 0; int result = 0;
...@@ -120,7 +120,7 @@ static void symbol_close(struct usb_serial_port *port) ...@@ -120,7 +120,7 @@ static void symbol_close(struct usb_serial_port *port)
static void symbol_throttle(struct tty_struct *tty) static void symbol_throttle(struct tty_struct *tty)
{ {
struct usb_serial_port *port = tty->driver_data; struct usb_serial_port *port = tty->driver_data;
struct symbol_private *priv = usb_get_serial_data(port->serial); struct symbol_private *priv = usb_get_serial_port_data(port);
spin_lock_irq(&priv->lock); spin_lock_irq(&priv->lock);
priv->throttled = true; priv->throttled = true;
...@@ -130,7 +130,7 @@ static void symbol_throttle(struct tty_struct *tty) ...@@ -130,7 +130,7 @@ static void symbol_throttle(struct tty_struct *tty)
static void symbol_unthrottle(struct tty_struct *tty) static void symbol_unthrottle(struct tty_struct *tty)
{ {
struct usb_serial_port *port = tty->driver_data; struct usb_serial_port *port = tty->driver_data;
struct symbol_private *priv = usb_get_serial_data(port->serial); struct symbol_private *priv = usb_get_serial_port_data(port);
int result; int result;
bool was_throttled; bool was_throttled;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment