All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Joseph Barrow <D.Barow-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
To: Alan Cox <alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
Cc: Linux netdev Mailing list
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux USB kernel mailing list
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH1/1] hso modem detect fix patch against Alan Cox'es tty tree
Date: Mon, 08 Dec 2008 15:38:31 +0100	[thread overview]
Message-ID: <493D3167.200@option.com> (raw)

[-- 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);

             reply	other threads:[~2008-12-08 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08 14:38 Denis Joseph Barrow [this message]
2008-12-09 23:53 ` [PATCH1/1] hso modem detect fix patch against Alan Cox'es tty tree David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=493D3167.200@option.com \
    --to=d.barow-x9gzzrpc1qbqt0dzr+alfa@public.gmane.org \
    --cc=alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.