Skip to contentSkip to conversation

patch "USB: serial: visor: fix crash on detecting device without write_urbs" added to usb-linus

PATCH [email protected] 1 participant 1 message Jan 28, 2016

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: visor: fix crash on detecting device without write_urbs

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From cb3232138e37129e88240a98a1d2aba2187ff57c Mon Sep 17 00:00:00 2001

From: Vladis Dronov <[email protected]>
Date: Tue, 12 Jan 2016 15:10:50 +0100
Subject: USB: serial: visor: fix crash on detecting device without write_urbs

The visor driver crashes in clie_5_attach() when a specially crafted USB device without bulk-out endpoint is detected. This fix adds a check that the device has proper configuration expected by the driver.

Fixes cfb8da8f69b8 ("USB: visor: fix initialisation of UX50/TH55 devices")
Cc stable <[email protected]>
---
 drivers/usb/serial/visor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/serial/visor.c +4 -2
index c53fbb3e0b8c..337a0be89fcf 100644
@@ -602,8 +602,10 @@ static int clie_5_attach(struct usb_serial *serial)
 	 */
 
 	/* some sanity check */
-	if (serial->num_ports < 2)
-		return -1;
+	if (serial->num_bulk_out < 2) {
+		dev_err(&serial->interface->dev, "missing bulk out endpoints\n");
+		return -ENODEV;
+	}
 
 	/* port 0 now uses the modified endpoint Address */
 	port = serial->port[0];
Signature · 1 line
2.7.0