Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -550,10 +550,13 @@ static int pl2303_tiocmset(struct tty_struct *tty,
	spin_unlock_irqrestore(&priv->lock, flags);
	spin_unlock_irqrestore(&priv->lock, flags);


	mutex_lock(&serial->disc_mutex);
	mutex_lock(&serial->disc_mutex);
	if (!serial->disconnected)
	if (!serial->disconnected) {
		ret = pl2303_set_control_lines(port, control);
		ret = pl2303_set_control_lines(port, control);
	else
		if (ret)
			ret = usb_translate_errors(ret);
	} else {
		ret = -ENODEV;
		ret = -ENODEV;
	}
	mutex_unlock(&serial->disc_mutex);
	mutex_unlock(&serial->disc_mutex);


	return ret;
	return ret;