netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH1/1] hso modem detect fix patch against Alan Cox'es tty tree
@ 2008-12-08 14:38 Denis Joseph Barrow
  2008-12-09 23:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Joseph Barrow @ 2008-12-08 14:38 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux netdev Mailing list, Linux USB kernel mailing list

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

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-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
---
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);



-- 
best regards,
D.J. Barrow

Linux Kernel Developer
Option NV, Gaston Geenslaan 14, 3001 Leuven, Belgium
 
T: +32 16 311 621
F: +32 16 207 164
M: +32 4xx xxx xxx
d.barow-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org
www.option.com

Disclaimer:
http://www.option.com/company/disclaimer.shtml
 RPR Leuven 0429.375.448

[-- Attachment #2: tty-hso-modem.fix.patch --]
[-- Type: text/x-diff, Size: 814 bytes --]

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-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
---
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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-09 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08 14:38 [PATCH1/1] hso modem detect fix patch against Alan Cox'es tty tree Denis Joseph Barrow
2008-12-09 23:53 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).