hso modem detect fix patch against Alan Cox'es tty tree
authorDenis Joseph Barrow <[email protected]>
Fri, 2 Jan 2009 13:50:29 +0000 (13:50 +0000)
committerLinus Torvalds <[email protected]>
Fri, 2 Jan 2009 18:19:43 +0000 (10:19 -0800)
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 <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/net/usb/hso.c

index d974d970e5fddcaeda9f358d4536f7e4c00543be..148af34837f099ffa9a134a44380cbcf056d111c 100644 (file)
@@ -2663,7 +2663,7 @@ static struct hso_device *hso_create_bulk_serial_device(
        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);