From: <gregkh@linuxfoundation.org>
To: johan@kernel.org, gregkh@linuxfoundation.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "USB: serial: ti_usb_3410_5052: fix control-message error handling" has been added to the 4.9-stable tree
Date: Tue, 09 May 2017 11:42:18 +0200 [thread overview]
Message-ID: <14943229383894@kroah.com> (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 4.9-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-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 39712e8bfa8d3aa6ce1e60fc9d62c9b076c17a30 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Thu, 12 Jan 2017 14:56:23 +0100
Subject: USB: serial: ti_usb_3410_5052: fix control-message error handling
From: Johan Hovold <johan@kernel.org>
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")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/ti_usb_3410_5052.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1556,13 +1556,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;
}
@@ -1578,8 +1575,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 johan@kernel.org are
queue-4.9/usb-serial-mct_u232-fix-modem-status-error-handling.patch
queue-4.9/usb-serial-ark3116-fix-open-error-handling.patch
queue-4.9/usb-serial-io_edgeport-fix-epic-descriptor-handling.patch
queue-4.9/usb-serial-ti_usb_3410_5052-fix-control-message-error-handling.patch
queue-4.9/usb-serial-keyspan_pda-fix-receive-sanity-checks.patch
queue-4.9/usb-serial-sierra-fix-bogus-alternate-setting-assumption.patch
queue-4.9/usb-serial-ssu100-fix-control-message-error-handling.patch
queue-4.9/usb-serial-digi_acceleport-fix-incomplete-rx-sanity-check.patch
queue-4.9/usb-serial-io_edgeport-fix-descriptor-error-handling.patch
queue-4.9/usb-serial-quatech2-fix-control-message-error-handling.patch
queue-4.9/usb-serial-ftdi_sio-fix-latency-timer-error-handling.patch
reply other threads:[~2017-05-09 9:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14943229383894@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.