Skip to contentSkip to conversation

Patch "USB: serial: ti_usb_3410_5052: fix control-message error handling" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message May 9, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: serial: ti_usb_3410_5052: fix control-message error handling

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:

     usb-serial-ti_usb_3410_5052-fix-control-message-error-handling.patch

and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 39712e8bfa8d3aa6ce1e60fc9d62c9b076c17a30 Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Thu, 12 Jan 2017 14:56:23 +0100
Subject: USB: serial: ti_usb_3410_5052: fix control-message error handling

From: Johan Hovold <[email protected]>

commit 39712e8bfa8d3aa6ce1e60fc9d62c9b076c17a30 upstream.

Make sure to detect and return an error on zero-length control-message transfers when reading from the device.

This addresses a potential failure to detect an empty transmit buffer during close.

Also remove a redundant check for short transfer when sending a command.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 drivers/usb/serial/ti_usb_3410_5052.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/usb/serial/ti_usb_3410_5052.c +4 -8
@@ -1343,13 +1343,10 @@ static int ti_command_out_sync(struct ti
 		(USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT),
 		value, moduleid, data, size, 1000);
 
-	if (status == size)
-		status = 0;
-
-	if (status > 0)
-		status = -ECOMM;
+	if (status < 0)
+		return status;
 
-	return status;
+	return 0;
 }
 
 
@@ -1365,8 +1362,7 @@ static int ti_command_in_sync(struct ti_
 
 	if (status == size)
 		status = 0;
-
-	if (status > 0)
+	else if (status >= 0)
 		status = -ECOMM;
 
 	return status;

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/usb-serial-mct_u232-fix-modem-status-error-handling.patch queue-3.18/usb-serial-ark3116-fix-open-error-handling.patch queue-3.18/usb-serial-io_edgeport-fix-epic-descriptor-handling.patch queue-3.18/usb-serial-ti_usb_3410_5052-fix-control-message-error-handling.patch queue-3.18/usb-serial-keyspan_pda-fix-receive-sanity-checks.patch queue-3.18/usb-serial-sierra-fix-bogus-alternate-setting-assumption.patch queue-3.18/usb-serial-ssu100-fix-control-message-error-handling.patch queue-3.18/usb-serial-digi_acceleport-fix-incomplete-rx-sanity-check.patch queue-3.18/usb-serial-io_edgeport-fix-descriptor-error-handling.patch queue-3.18/usb-serial-quatech2-fix-control-message-error-handling.patch queue-3.18/usb-serial-ftdi_sio-fix-latency-timer-error-handling.patch