提交 aff5b323 编写于 作者: J Johan Hovold 提交者: 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: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册