Skip to contentSkip to conversation

FAILED: patch "[PATCH] USB: serial: cp210x: fix tiocmget error handling" failed to apply to 4.4-stable tree

PATCH In review [email protected] 2 participants 3 messages Nov 7, 2016 – Nov 8, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From de24e0a108bc48062e1c7acaa97014bce32a919f Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Wed, 19 Oct 2016 15:45:07 +0200
Subject: [PATCH] USB: serial: cp210x: fix tiocmget error handling

The current tiocmget implementation would fail to report errors up the stack and instead leaked a few bits from the stack as a mask of modem-status flags.

Fixes 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control")
Cc stable <[email protected]>
drivers/usb/serial/cp210x.c +3 -1
index 54a4de0efdba..f61477bed3a8 100644
@@ -1077,7 +1077,9 @@ static int cp210x_tiocmget(struct tty_struct *tty)
 	u8 control;
 	int result;
 
-	cp210x_read_u8_reg(port, CP210X_GET_MDMSTS, &control);
+	result = cp210x_read_u8_reg(port, CP210X_GET_MDMSTS, &control);
+	if (result)
+		return result;
 
 	result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
 		|((control & CONTROL_RTS) ? TIOCM_RTS : 0)
maintainer
#1 lore raw

PATCH 1/1 USB: serial: cp210x: fix tiocmget error handling

commit de24e0a108bc48062e1c7acaa97014bce32a919f upstream.

The current tiocmget implementation would fail to report errors up the stack and instead leaked a few bits from the stack as a mask of modem-status flags.

Fixes 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control")

---

Here's a backport of de24e0a108bc ("USB: serial: cp210x: fix tiocmget error handling") to 4.4.

Johan

 drivers/usb/serial/cp210x.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/serial/cp210x.c +3 -1
index 6eccded3bc33..976195e748a3 100644
@@ -845,7 +845,9 @@ static int cp210x_tiocmget(struct tty_struct *tty)
 	unsigned int control;
 	int result;
 
-	cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
+	result = cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
+	if (result)
+		return result;
 
 	result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
 		|((control & CONTROL_RTS) ? TIOCM_RTS : 0)
Signature · 1 line
2.7.3
author maintainer
#2 lore raw

Re: [PATCH stable-4.4] USB: serial: cp210x: fix tiocmget error handling

Quoted 6 lines · Johan Hovold

commit de24e0a108bc48062e1c7acaa97014bce32a919f upstream.

The current tiocmget implementation would fail to report errors up the stack and instead leaked a few bits from the stack as a mask of modem-status flags.

Quoted 6 lines
Fixes 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control")

---

Here's a backport of de24e0a108bc ("USB: serial: cp210x: fix tiocmget error handling") to 4.4.

Thanks, now applied.

greg k-h