From: Johan Hovold Date: Thu, 21 Mar 2013 11:37:44 +0000 (+0100) Subject: USB: pl2303: fix return value of tiocmset X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aff5b323b319758257a838cdc45f494c6674447c;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 997eba4dcbe..4dff17902fa 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -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;