From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43718 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421AbdEIJnz (ORCPT ); Tue, 9 May 2017 05:43:55 -0400 Subject: Patch "USB: serial: ti_usb_3410_5052: fix control-message error handling" has been added to the 4.9-stable tree To: johan@kernel.org, gregkh@linuxfoundation.org Cc: , From: Date: Tue, 09 May 2017 11:42:18 +0200 Message-ID: <14943229383894@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From 39712e8bfa8d3aa6ce1e60fc9d62c9b076c17a30 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 12 Jan 2017 14:56:23 +0100 Subject: USB: serial: ti_usb_3410_5052: fix control-message error handling From: Johan Hovold 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 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- 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