From: Greg KH <greg@kroah.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org,
Jari Tenhunen <jari.tenhunen@iki.fi>,
Olivier Blin <blino@mandriva.com>,
Andrew Bird <ajb@spheresystems.co.uk>,
Paul Rolland <rol@witbe.net>,
Arjan van de Ven <arjan@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [01/04] hso: fix oops in read/write callbacks
Date: Fri, 8 Aug 2008 12:01:11 -0700 [thread overview]
Message-ID: <20080808190111.GB2953@kroah.com> (raw)
In-Reply-To: <20080808190023.GA2953@kroah.com>
From: Olivier Blin <blino@mandriva.com>
The tty may be closed already when the read/write callbacks are called.
This patch checks that the ttys still exist before waking them up.
Signed-off-by: Olivier Blin <blino@mandriva.com>
Acked-by: Alan Cox <alan@redhat.com>
Cc: Jari Tenhunen <jari.tenhunen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/usb/hso.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1467,7 +1467,8 @@ static void hso_std_serial_write_bulk_ca
return;
}
hso_put_activity(serial->parent);
- tty_wakeup(serial->tty);
+ if (serial->tty)
+ tty_wakeup(serial->tty);
hso_kick_transmit(serial);
D1(" ");
@@ -1538,7 +1539,8 @@ static void ctrl_callback(struct urb *ur
clear_bit(HSO_SERIAL_FLAG_RX_SENT, &serial->flags);
} else {
hso_put_activity(serial->parent);
- tty_wakeup(serial->tty);
+ if (serial->tty)
+ tty_wakeup(serial->tty);
/* response to a write command */
hso_kick_transmit(serial);
}
next prev parent reply other threads:[~2008-08-08 19:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 19:00 [00/04] HSO driver bugfixes and updates Greg KH
2008-08-08 19:01 ` Greg KH [this message]
[not found] ` <20080808190023.GA2953-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2008-08-08 19:01 ` [02/04] hso: fix refcounting on the ttyHSx devices Greg KH
2008-08-09 8:39 ` Paul Rolland
2008-08-08 19:02 ` [03/04] USB: HSO: make tty_operations const Greg KH
2008-08-08 19:02 ` [04/04] USB: HSO: minor fixes due to code review Greg KH
2008-08-14 8:45 ` Jeff Garzik
2008-08-08 20:53 ` [00/04] HSO driver bugfixes and updates David Brownell
[not found] ` <200808081353.30130.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-08-14 8:45 ` Jeff Garzik
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=20080808190111.GB2953@kroah.com \
--to=greg@kroah.com \
--cc=ajb@spheresystems.co.uk \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=blino@mandriva.com \
--cc=jari.tenhunen@iki.fi \
--cc=jgarzik@pobox.com \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rol@witbe.net \
/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 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).