From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:33870 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbdBWU6I (ORCPT ); Thu, 23 Feb 2017 15:58:08 -0500 Subject: Patch "USB: serial: spcp8x5: fix modem-status handling" has been added to the 4.10-stable tree To: johan@kernel.org, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 23 Feb 2017 21:56:21 +0100 Message-ID: <1487883381124119@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: spcp8x5: fix modem-status handling to the 4.10-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-spcp8x5-fix-modem-status-handling.patch and it can be found in the queue-4.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 5ed8d41023751bdd3546f2fe4118304357efe8d2 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 12 Jan 2017 14:56:21 +0100 Subject: USB: serial: spcp8x5: fix modem-status handling From: Johan Hovold commit 5ed8d41023751bdd3546f2fe4118304357efe8d2 upstream. Make sure to detect short control transfers and return zero on success when retrieving the modem status. This fixes the TIOCMGET implementation which since e1ed212d8593 ("USB: spcp8x5: add proper modem-status support") has returned TIOCM_LE on successful retrieval, and avoids leaking bits from the stack on short transfers. This also fixes the carrier-detect implementation which since the above mentioned commit unconditionally has returned true. Fixes: e1ed212d8593 ("USB: spcp8x5: add proper modem-status support") Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/spcp8x5.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -232,11 +232,17 @@ static int spcp8x5_get_msr(struct usb_se ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), GET_UART_STATUS, GET_UART_STATUS_TYPE, 0, GET_UART_STATUS_MSR, buf, 1, 100); - if (ret < 0) + if (ret < 1) { dev_err(&port->dev, "failed to get modem status: %d\n", ret); + if (ret >= 0) + ret = -EIO; + goto out; + } dev_dbg(&port->dev, "0xc0:0x22:0:6 %d - 0x02%x\n", ret, *buf); *status = *buf; + ret = 0; +out: kfree(buf); return ret; Patches currently in stable-queue which might be from johan@kernel.org are queue-4.10/usb-serial-ftdi_sio-fix-modem-status-error-handling.patch queue-4.10/usb-serial-cp210x-add-new-ids-for-ge-bx50v3-boards.patch queue-4.10/usb-serial-ark3116-fix-register-accessor-error-handling.patch queue-4.10/usb-serial-digi_acceleport-fix-oob-data-sanity-check.patch queue-4.10/usb-serial-ftdi_sio-fix-line-status-over-reporting.patch queue-4.10/usb-serial-ftdi_sio-fix-extreme-low-latency-setting.patch queue-4.10/usb-serial-spcp8x5-fix-modem-status-handling.patch queue-4.10/usb-serial-opticon-fix-cts-retrieval-at-open.patch queue-4.10/usb-serial-mos7840-fix-another-null-deref-at-open.patch queue-4.10/usb-serial-console-fix-uninitialised-spinlock.patch