USB: symbolserial: Use usb_get_serial_port_data
authorPhilipp Hachtmann <hachti@hachti.de>
Mon, 17 Aug 2015 15:31:46 +0000 (17:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Aug 2015 17:06:22 +0000 (10:06 -0700)
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: Philipp Hachtmann <hachti@hachti.de>
Fixes: a85796ee5149 ("USB: symbolserial: move private-data allocation to
port_probe")
Cc: stable <stable@vger.kernel.org> # v3.10
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/symbolserial.c

index 8fceec7298e007919f8585a93e9298d2256e6bb7..6ed804450a5a6a0a0a8e3f4584b420da94948d8c 100644 (file)
@@ -94,7 +94,7 @@ exit:
 
 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;
        int result = 0;
 
@@ -120,7 +120,7 @@ static void symbol_close(struct usb_serial_port *port)
 static void symbol_throttle(struct tty_struct *tty)
 {
        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);
        priv->throttled = true;
@@ -130,7 +130,7 @@ static void symbol_throttle(struct tty_struct *tty)
 static void symbol_unthrottle(struct tty_struct *tty)
 {
        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;
        bool was_throttled;