Commit aff5b323 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: pl2303: fix return value of tiocmset

Make sure we return 0 or a negative error number appropriate for
userspace on errors.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 94bcef62
......@@ -550,10 +550,13 @@ static int pl2303_tiocmset(struct tty_struct *tty,
spin_unlock_irqrestore(&priv->lock, flags);
mutex_lock(&serial->disc_mutex);
if (!serial->disconnected)
if (!serial->disconnected) {
ret = pl2303_set_control_lines(port, control);
else
if (ret)
ret = usb_translate_errors(ret);
} else {
ret = -ENODEV;
}
mutex_unlock(&serial->disc_mutex);
return ret;
......
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