Skip to content

Commit

Permalink
USB: symbolserial: Use usb_get_serial_port_data
Browse files Browse the repository at this point in the history
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: a85796e ("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>
  • Loading branch information
Philipp Hachtmann authored and Greg Kroah-Hartman committed Aug 18, 2015
1 parent a0c9d0d commit 951d379
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/serial/symbolserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
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;

Expand All @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 951d379

Please sign in to comment.