Patch "USB: serial: kl5kusb105: fix open error path" has been added to the 4.8-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
USB: serial: kl5kusb105: fix open error path
to the 4.8-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-kl5kusb105-fix-open-error-path.patch
and it can be found in the queue-4.8 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
6774d5f53271d5f60464f824748995b71da401abMon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Tue, 29 Nov 2016 16:55:01 +0100
Subject: USB: serial: kl5kusb105: fix open error path
From: Johan Hovold <[email protected]>
commit 6774d5f53271d5f60464f824748995b71da401ab upstream.
Kill urbs and disable read before returning from open on failure to retrieve the line state.
--- drivers/usb/serial/kl5kusb105.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-)
drivers/usb/serial/kl5kusb105.c +24 -9
@@ -296,7 +296,7 @@ static int klsi_105_open(struct tty_str rc =usb_serial_generic_open (tty, port);if (rc) { retval = rc; - goto exit; + goto err_free_cfg; } rc = usb_control_msg(port->serial->dev,
@@ -315,17 +315,32 @@ static int klsi_105_open(struct tty_strdev_dbg (&port->dev,"%s - enabled reading\n" , __func__); rc =klsi_105_get_line_state (port, &line_state); -if (rc >=0 ) { -spin_lock_irqsave (&priv->lock, flags); - priv->line_state = line_state; -spin_unlock_irqrestore (&priv->lock, flags); -dev_dbg (&port->dev,"%s - read line state 0x%lx\n" , __func__, line_state); - retval =0 ; - }else +if (rc <0 ) { retval = rc; + goto err_disable_read; + } + +spin_lock_irqsave (&priv->lock, flags); + priv->line_state = line_state; +spin_unlock_irqrestore (&priv->lock, flags); +dev_dbg (&port->dev,"%s - read line state 0x%lx\n" , __func__, + line_state); + +return 0 ; -exit: +err_disable_read: +usb_control_msg (port->serial->dev, +usb_sndctrlpipe (port->serial->dev,0 ), +KL5KUSB105A_SIO_CONFIGURE , +USB_TYPE_VENDOR |USB_DIR_OUT , +KL5KUSB105A_SIO_CONFIGURE_READ_OFF , +0 ,/* index */ +NULL ,0 , +KLSI_TIMEOUT ); +usb_serial_generic_close (port); +err_free_cfg:kfree (cfg); +return retval; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.8/usb-serial-kl5kusb105-fix-open-error-path.patch queue-4.8/usb-serial-option-add-dlink-dwm-158.patch queue-4.8/usb-serial-option-add-support-for-telit-le922a-pids-0x1040-0x1041.patch