Skip to contentSkip to conversation

Patch "USB: serial: kl5kusb105: abort on open exception path" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jan 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: kl5kusb105: abort on open exception path

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-kl5kusb105-abort-on-open-exception-path.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 <[email protected]> know about it.

Quoted 1 line

From 3c3dd1e058cb01e835dcade4b54a6f13ffaeaf7c Mon Sep 17 00:00:00 2001

From: Pan Bian <[email protected]>
Date: Tue, 29 Nov 2016 16:55:02 +0100
Subject: USB: serial: kl5kusb105: abort on open exception path

From: Pan Bian <[email protected]>

commit 3c3dd1e058cb01e835dcade4b54a6f13ffaeaf7c upstream.

Function klsi_105_open() calls usb_control_msg() (to "enable read") and checks its return value. When the return value is unexpected, it only assigns the error code to the return variable retval, but does not terminate the exception path. This patch fixes the bug by inserting "goto err_generic_close;" when the call to usb_control_msg() fails.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
[johan: rebase on prerequisite fix and amend commit message]
---
 drivers/usb/serial/kl5kusb105.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/usb/serial/kl5kusb105.c +2 -0
@@ -311,6 +311,7 @@ static int  klsi_105_open(struct tty_str
 	if (rc < 0) {
 		dev_err(&port->dev, "Enabling read failed (error = %d)\n", rc);
 		retval = rc;
+		goto err_generic_close;
 	} else
 		dev_dbg(&port->dev, "%s - enabled reading\n", __func__);
 
@@ -337,6 +338,7 @@ err_disable_read:
 			     0, /* index */
 			     NULL, 0,
 			     KLSI_TIMEOUT);
+err_generic_close:
 	usb_serial_generic_close(port);
 err_free_cfg:
 	kfree(cfg);

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

queue-4.9/usb-serial-kl5kusb105-abort-on-open-exception-path.patch queue-4.9/usb-return-error-code-when-platform_get_irq-fails.patch