Patchwork [PATCH1/1] hso modem detect fix patch against Alan Cox'es tty tree

login
register
mail settings
Submitter Denis Joseph Barrow
Date Dec. 8, 2008, 2:38 p.m.
Message ID <493D3167.200@option.com>
Download mbox | patch
Permalink /patch/12775/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Denis Joseph Barrow - Dec. 8, 2008, 2:38 p.m.
Here you go good sir,

Fixed incorrect check for the modem port, this prevents
crashes caused by issueing a tiocmget_submit_urb
on endpoints which don't exist for non modem devices. 
Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
---
David Miller - Dec. 9, 2008, 11:53 p.m.
From: Denis Joseph Barrow <D.Barow@option.com>
Date: Mon, 08 Dec 2008 15:38:31 +0100

> Fixed incorrect check for the modem port, this prevents
> crashes caused by issueing a tiocmget_submit_urb
> on endpoints which don't exist for non modem devices. 
>
> Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>

Alan, you got this one or want me to grab it?

I'm fine either way.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

Fixed incorrect check for the modem port, this prevents
crashes caused by issueing a tiocmget_submit_urb
on endpoints which don't exist for non modem devices. 
Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
---
Index: linux-2.6.28-rc7.alan/drivers/net/usb/hso.c
===================================================================
--- linux-2.6.28-rc7.alan.orig/drivers/net/usb/hso.c	2008-12-08 15:26:00.000000000 +0100
+++ linux-2.6.28-rc7.alan/drivers/net/usb/hso.c	2008-12-08 15:28:10.000000000 +0100
@@ -2659,7 +2659,7 @@ 
 	serial->parent = hso_dev;
 	hso_dev->port_data.dev_serial = serial;
 
-	if (port & HSO_PORT_MODEM) {
+	if ((port & HSO_PORT_MASK) == HSO_PORT_MODEM) {
 		num_urbs = 2;
 		serial->tiocmget = kzalloc(sizeof(struct hso_tiocmget),
 					   GFP_KERNEL);