Skip to content

Commit

Permalink
USB: ftdi_sio: fix TIOCSSERIAL baud_base handling
Browse files Browse the repository at this point in the history
Return EINVAL if new baud_base does not match the current one.

The baud_base is device specific and can not be changed. This restores
the old (pre-2005) behaviour which was changed due to a
misunderstanding regarding this fact (see
https://lkml.org/lkml/2005/1/20/84).

Reported-by: Torbjörn Lofterud <torbjorn@pi.nxs.se>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Jan 24, 2012
1 parent 55305af commit eb833a9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,8 +1333,7 @@ static int set_serial_info(struct tty_struct *tty,
goto check_and_exit;
}

if ((new_serial.baud_base != priv->baud_base) &&
(new_serial.baud_base < 9600)) {
if (new_serial.baud_base != priv->baud_base) {
mutex_unlock(&priv->cfg_lock);
return -EINVAL;
}
Expand Down

0 comments on commit eb833a9

Please sign in to comment.