Skip to content

Commit

Permalink
USB: oti6858: fix abuse of interface data
Browse files Browse the repository at this point in the history
Fix abuse of interface data which was used to signal device disconnect.

Note that neither tiocmset or tiocmget need to check for disconnect as
they do not access the device.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Apr 25, 2012
1 parent 81d5a67 commit 1c51766
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/usb/serial/oti6858.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,6 @@ static int oti6858_tiocmset(struct tty_struct *tty,
dbg("%s(port = %d, set = 0x%08x, clear = 0x%08x)",
__func__, port->number, set, clear);

if (!usb_get_intfdata(port->serial->interface))
return -ENODEV;

/* FIXME: check if this is correct (active high/low) */
spin_lock_irqsave(&priv->lock, flags);
control = priv->pending_setup.control;
Expand Down Expand Up @@ -665,9 +662,6 @@ static int oti6858_tiocmget(struct tty_struct *tty)

dbg("%s(port = %d)", __func__, port->number);

if (!usb_get_intfdata(port->serial->interface))
return -ENODEV;

spin_lock_irqsave(&priv->lock, flags);
pin_state = priv->status.pin_state & PIN_MASK;
spin_unlock_irqrestore(&priv->lock, flags);
Expand Down

0 comments on commit 1c51766

Please sign in to comment.